From f33639e6fdf175b6f5f502b4694eaf31d6cc36f0 Mon Sep 17 00:00:00 2001 From: James Mulcahy Date: Tue, 6 Oct 2026 20:44:20 -0700 Subject: [PATCH 1/2] Send per-event buzzer sounds to panels in NSPanelConfig Add a repeated Sound field to NSPanelConfig that maps panel events (TOUCH, SCENE_ACTIVATED, SCENE_SAVED) to RTTTL melodies, for the panel buzzer support added to the firmware in NSPanelManager-firmware#29. The sounds come from three new global settings, buzzer_sound_touch, buzzer_sound_scene_activated and buzzer_sound_scene_saved, which a panel setting with the same name overrides. They default to empty, which sends no entry and leaves the event silent, so panels behave as before until a sound is configured. There is no UI for them yet; set them through POST /rest/settings. Generated with protoc 27.0. Co-Authored-By: Claude Opus 5.5 --- .../mqtt_manager_config.hpp | 6 + .../MQTTManager/include/nspanel/nspanel.cpp | 17 + .../include/protobuf/protobuf_nspanel.pb.cc | 606 +++++++++++++----- .../include/protobuf/protobuf_nspanel.pb.h | 435 ++++++++++++- docker/protobuf/protobuf_nspanel.proto | 13 + 5 files changed, 909 insertions(+), 168 deletions(-) diff --git a/docker/MQTTManager/include/mqtt_manager_config/mqtt_manager_config.hpp b/docker/MQTTManager/include/mqtt_manager_config/mqtt_manager_config.hpp index bfef1ab6..4e7d2be0 100644 --- a/docker/MQTTManager/include/mqtt_manager_config/mqtt_manager_config.hpp +++ b/docker/MQTTManager/include/mqtt_manager_config/mqtt_manager_config.hpp @@ -72,6 +72,9 @@ enum MQTT_MANAGER_SETTING { OPTIMISTIC_MODE, LIGHT_TURN_ON_BRIGHTNESS, DEFAULT_NSPANEL_TYPE, + BUZZER_SOUND_TOUCH, + BUZZER_SOUND_SCENE_ACTIVATED, + BUZZER_SOUND_SCENE_SAVED, LAST, // Keep last as to be able to reference the last element in the list. }; @@ -228,6 +231,9 @@ class MqttManagerConfig { {MQTT_MANAGER_SETTING::OPTIMISTIC_MODE, {"optimistic_mode", "True"}}, {MQTT_MANAGER_SETTING::LIGHT_TURN_ON_BRIGHTNESS, {"light_turn_on_brightness", "50"}}, {MQTT_MANAGER_SETTING::DEFAULT_NSPANEL_TYPE, {"default_nspanel_type", "eu"}}, + {MQTT_MANAGER_SETTING::BUZZER_SOUND_TOUCH, {"buzzer_sound_touch", ""}}, // RTTTL, empty for no sound + {MQTT_MANAGER_SETTING::BUZZER_SOUND_SCENE_ACTIVATED, {"buzzer_sound_scene_activated", ""}}, + {MQTT_MANAGER_SETTING::BUZZER_SOUND_SCENE_SAVED, {"buzzer_sound_scene_saved", ""}}, #if defined(TEST_MODE) && TEST_MODE == 1 {MQTT_MANAGER_SETTING::LAST, {"last", "last_value"}}, #endif diff --git a/docker/MQTTManager/include/nspanel/nspanel.cpp b/docker/MQTTManager/include/nspanel/nspanel.cpp index 8aca5fe7..2017c7b3 100644 --- a/docker/MQTTManager/include/nspanel/nspanel.cpp +++ b/docker/MQTTManager/include/nspanel/nspanel.cpp @@ -47,6 +47,8 @@ #include #include #include +#include +#include #include NSPanel::NSPanel(uint32_t id) { @@ -479,6 +481,21 @@ void NSPanel::send_config() { SPDLOG_WARN("No global entities pages were loaded while building config for NSPanel {}::{}", this->_id, this->_name); } + // Load buzzer sounds. A panel setting overrides the global one, an empty value means no sound for that event. + const std::vector> sound_settings = { + {NSPanelConfig_NSPanelSoundEvent_TOUCH, "buzzer_sound_touch", MQTT_MANAGER_SETTING::BUZZER_SOUND_TOUCH}, + {NSPanelConfig_NSPanelSoundEvent_SCENE_ACTIVATED, "buzzer_sound_scene_activated", MQTT_MANAGER_SETTING::BUZZER_SOUND_SCENE_ACTIVATED}, + {NSPanelConfig_NSPanelSoundEvent_SCENE_SAVED, "buzzer_sound_scene_saved", MQTT_MANAGER_SETTING::BUZZER_SOUND_SCENE_SAVED}, + }; + for (const auto &[event, nspanel_setting_key, global_setting] : sound_settings) { + std::string rtttl = this->_get_nspanel_setting_with_default(nspanel_setting_key, MqttManagerConfig::get_setting_with_default(global_setting)); + if (!rtttl.empty()) { + NSPanelConfig_Sound *sound = config.add_sounds(); + sound->set_event(event); + sound->set_rtttl(rtttl); + } + } + SPDLOG_DEBUG("Sending updated NSPanelConfig to panel {}::{} over MQTT.", this->_id, this->_name); MQTT_Manager::publish_protobuf(this->_mqtt_config_topic, config, true); } diff --git a/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.cc b/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.cc index 7ffd0ad4..65f882d7 100644 --- a/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.cc +++ b/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.cc @@ -349,6 +349,28 @@ struct NSPanelMQTTManagerCommand_ButtonPressedDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NSPanelMQTTManagerCommand_ButtonPressedDefaultTypeInternal _NSPanelMQTTManagerCommand_ButtonPressed_default_instance_; +inline constexpr NSPanelConfig_Sound::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : rtttl_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + event_{static_cast< ::NSPanelConfig_NSPanelSoundEvent >(0)}, + _cached_size_{0} {} + +template +PROTOBUF_CONSTEXPR NSPanelConfig_Sound::NSPanelConfig_Sound(::_pbi::ConstantInitialized) + : _impl_(::_pbi::ConstantInitialized()) {} +struct NSPanelConfig_SoundDefaultTypeInternal { + PROTOBUF_CONSTEXPR NSPanelConfig_SoundDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~NSPanelConfig_SoundDefaultTypeInternal() {} + union { + NSPanelConfig_Sound _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NSPanelConfig_SoundDefaultTypeInternal _NSPanelConfig_Sound_default_instance_; + inline constexpr NSPanelConfig_RoomInfo::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : entity_page_ids_{}, @@ -509,6 +531,7 @@ inline constexpr NSPanelConfig::Impl_::Impl_( _relay1_relay_group_cached_byte_size_{0}, relay2_relay_group_{}, _relay2_relay_group_cached_byte_size_{0}, + sounds_{}, name_( &::google::protobuf::internal::fixed_address_empty_string, ::_pbi::ConstantInitialized()), @@ -560,7 +583,7 @@ struct NSPanelConfigDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NSPanelConfigDefaultTypeInternal _NSPanelConfig_default_instance_; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_protobuf_5fnspanel_2eproto[8]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_protobuf_5fnspanel_2eproto[9]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_protobuf_5fnspanel_2eproto = nullptr; const ::uint32_t @@ -578,6 +601,16 @@ const ::uint32_t PROTOBUF_FIELD_OFFSET(::NSPanelConfig_RoomInfo, _impl_.entity_page_ids_), PROTOBUF_FIELD_OFFSET(::NSPanelConfig_RoomInfo, _impl_.scene_page_ids_), ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::NSPanelConfig_Sound, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::NSPanelConfig_Sound, _impl_.event_), + PROTOBUF_FIELD_OFFSET(::NSPanelConfig_Sound, _impl_.rtttl_), + ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -621,6 +654,7 @@ const ::uint32_t PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.button1_upper_temperature_), PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.button2_lower_temperature_), PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.button2_upper_temperature_), + PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.sounds_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::NSPanelWarning, _internal_metadata_), ~0u, // no _extensions_ @@ -865,27 +899,29 @@ const ::uint32_t static const ::_pbi::MigrationSchema schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { {0, -1, -1, sizeof(::NSPanelConfig_RoomInfo)}, - {11, -1, -1, sizeof(::NSPanelConfig)}, - {55, -1, -1, sizeof(::NSPanelWarning)}, - {65, -1, -1, sizeof(::NSPanelStatusReport)}, - {88, -1, -1, sizeof(::NSPanelRoomEntitiesPage_EntitySlot)}, - {105, -1, -1, sizeof(::NSPanelRoomEntitiesPage)}, - {117, -1, -1, sizeof(::NSPanelRoomStatus)}, - {138, -1, -1, sizeof(::NSPanelWeatherUpdate_ForecastItem)}, - {151, -1, -1, sizeof(::NSPanelWeatherUpdate)}, - {167, -1, -1, sizeof(::NSPanelMQTTManagerCommand_FirstPageTurnLightOn)}, - {182, -1, -1, sizeof(::NSPanelMQTTManagerCommand_FirstPageTurnLightOff)}, - {192, -1, -1, sizeof(::NSPanelMQTTManagerCommand_LightCommand)}, - {209, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ToggleEntityFromEntitiesPage)}, - {219, -1, -1, sizeof(::NSPanelMQTTManagerCommand_SaveSceneCommand)}, - {229, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ButtonPressed)}, - {238, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ThermostatTemperatureCommand)}, - {248, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ThermostatCommand)}, - {259, -1, -1, sizeof(::NSPanelMQTTManagerCommand_MediaPlayerCommand)}, - {275, -1, -1, sizeof(::NSPanelMQTTManagerCommand)}, + {11, -1, -1, sizeof(::NSPanelConfig_Sound)}, + {21, -1, -1, sizeof(::NSPanelConfig)}, + {66, -1, -1, sizeof(::NSPanelWarning)}, + {76, -1, -1, sizeof(::NSPanelStatusReport)}, + {99, -1, -1, sizeof(::NSPanelRoomEntitiesPage_EntitySlot)}, + {116, -1, -1, sizeof(::NSPanelRoomEntitiesPage)}, + {128, -1, -1, sizeof(::NSPanelRoomStatus)}, + {149, -1, -1, sizeof(::NSPanelWeatherUpdate_ForecastItem)}, + {162, -1, -1, sizeof(::NSPanelWeatherUpdate)}, + {178, -1, -1, sizeof(::NSPanelMQTTManagerCommand_FirstPageTurnLightOn)}, + {193, -1, -1, sizeof(::NSPanelMQTTManagerCommand_FirstPageTurnLightOff)}, + {203, -1, -1, sizeof(::NSPanelMQTTManagerCommand_LightCommand)}, + {220, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ToggleEntityFromEntitiesPage)}, + {230, -1, -1, sizeof(::NSPanelMQTTManagerCommand_SaveSceneCommand)}, + {240, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ButtonPressed)}, + {249, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ThermostatTemperatureCommand)}, + {259, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ThermostatCommand)}, + {270, -1, -1, sizeof(::NSPanelMQTTManagerCommand_MediaPlayerCommand)}, + {286, -1, -1, sizeof(::NSPanelMQTTManagerCommand)}, }; static const ::_pb::Message* const file_default_instances[] = { &::_NSPanelConfig_RoomInfo_default_instance_._instance, + &::_NSPanelConfig_Sound_default_instance_._instance, &::_NSPanelConfig_default_instance_._instance, &::_NSPanelWarning_default_instance_._instance, &::_NSPanelStatusReport_default_instance_._instance, @@ -907,7 +943,7 @@ static const ::_pb::Message* const file_default_instances[] = { }; const char descriptor_table_protodef_protobuf_5fnspanel_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE( protodesc_cold) = { - "\n\026protobuf_nspanel.proto\"\216\r\n\rNSPanelConf" + "\n\026protobuf_nspanel.proto\"\303\016\n\rNSPanelConf" "ig\022\014\n\004name\030\001 \001(\t\022\024\n\014default_room\030\002 \001(\005\0227" "\n\014default_page\030\003 \001(\0162!.NSPanelConfig.NSP" "anelDefaultPage\022&\n\036screensaver_activatio" @@ -939,134 +975,138 @@ const char descriptor_table_protodef_protobuf_5fnspanel_2eproto[] ABSL_ATTRIBUTE "n1_lower_temperature\030) \001(\005\022!\n\031button1_up" "per_temperature\030* \001(\005\022!\n\031button2_lower_t" "emperature\030+ \001(\005\022!\n\031button2_upper_temper" - "ature\030, \001(\005\032L\n\010RoomInfo\022\017\n\007room_id\030\001 \001(\005" - "\022\027\n\017entity_page_ids\030\002 \003(\005\022\026\n\016scene_page_" - "ids\030\003 \003(\005\"8\n\022NSPanelDefaultPage\022\010\n\004HOME\020" - "\000\022\n\n\006SCENES\020\001\022\014\n\010ENTITIES\020\002\"\250\001\n\026NSPanelS" - "creensaverMode\022\033\n\027WEATHER_WITH_BACKGROUN" - "D\020\000\022\036\n\032WEATHER_WITHOUT_BACKGROUND\020\001\022\034\n\030D" - "ATETIME_WITH_BACKGROUND\020\003\022\037\n\033DATETIME_WI" - "THOUT_BACKGROUND\020\004\022\022\n\016NO_SCREENSAVER\020\005\"i" - "\n\021NSPanelButtonMode\022\n\n\006DIRECT\020\000\022\n\n\006FOLLO" - "W\020\001\022\022\n\016NOTIFY_MANAGER\020\002\022\023\n\017THERMOSTAT_HE" - "AT\020\003\022\023\n\017THERMOSTAT_COOL\020\004\"C\n\016NSPanelWarn" - "ing\022#\n\005level\030\001 \001(\0162\024.NSPanelWarningLevel" - "\022\014\n\004text\030\002 \001(\t\"\351\003\n\023NSPanelStatusReport\0221" - "\n\rnspanel_state\030\001 \001(\0162\032.NSPanelStatusRep" - "ort.state\022\027\n\017update_progress\030\002 \001(\005\022\014\n\004rs" - "si\030\003 \001(\005\022\025\n\rheap_used_pct\030\004 \001(\005\022\023\n\013mac_a" - "ddress\030\005 \001(\t\022\023\n\013temperature\030\006 \001(\002\022\022\n\nip_" - "address\030\007 \001(\t\022!\n\010warnings\030\010 \003(\0132\017.NSPane" - "lWarning\022\024\n\014md5_firmware\030\t \001(\t\022\024\n\014md5_li" - "ttlefs\030\n \001(\t\022\023\n\013md5_tft_gui\030\013 \001(\t\022\024\n\014has" - "_humidity\030\014 \001(\010\022\020\n\010humidity\030\r \001(\002\022\024\n\014has" - "_pressure\030\016 \001(\010\022\020\n\010pressure\030\017 \001(\002\"o\n\005sta" - "te\022\n\n\006ONLINE\020\000\022\013\n\007OFFLINE\020\001\022\020\n\014UPDATING_" - "TFT\020\002\022\025\n\021UPDATING_FIRMWARE\020\003\022\025\n\021UPDATING" - "_LITTLEFS\020\004\022\r\n\tREBOOTING\020\005\"\246\004\n\027NSPanelRo" - "omEntitiesPage\022\n\n\002id\030\001 \001(\005\022\021\n\tpage_type\030" - "\002 \001(\005\022\023\n\013header_text\030\003 \001(\t\0225\n\010entities\030\004" - " \003(\0132#.NSPanelRoomEntitiesPage.EntitySlo" - "t\032\237\003\n\nEntitySlot\022\032\n\022room_view_position\030\001" - " \001(\005\022\014\n\004name\030\002 \001(\t\022\014\n\004icon\030\003 \001(\t\022\013\n\003pco\030" - "\004 \001(\005\022\014\n\004pco2\030\005 \001(\005\022\026\n\016can_save_scene\030\006 " - "\001(\010\022\030\n\020mqtt_state_topic\030\007 \001(\t\022<\n\004type\030\010 " - "\001(\0162..NSPanelRoomEntitiesPage.EntitySlot" - ".EntityType\022\n\n\002id\030\t \001(\005\"\301\001\n\nEntityType\022\033" - "\n\027ENTITY_TYPE_UNSPECIFIED\020\000\022\025\n\021ENTITY_TY" - "PE_LIGHT\020\001\022\026\n\022ENTITY_TYPE_SWITCH\020\002\022\026\n\022EN" - "TITY_TYPE_BUTTON\020\003\022\032\n\026ENTITY_TYPE_THERMO" - "STAT\020\004\022\025\n\021ENTITY_TYPE_SCENE\020\005\022\034\n\030ENTITY_" - "TYPE_MEDIA_PLAYER\020\006\"\226\003\n\021NSPanelRoomStatu" - "s\022\n\n\002id\030\001 \001(\005\022\014\n\004name\030\002 \001(\t\022\031\n\021average_d" - "im_level\030\003 \001(\005\022 \n\030ceiling_lights_dim_lev" - "el\030\004 \001(\005\022\036\n\026table_lights_dim_level\030\005 \001(\005" - "\022!\n\031average_color_temperature\030\006 \001(\005\022.\n&c" - "eiling_lights_color_temperature_value\030\007 " - "\001(\005\022,\n$table_lights_color_temperature_va" - "lue\030\010 \001(\005\022\032\n\022num_ceiling_lights\030\t \001(\005\022\030\n" - "\020num_table_lights\030\n \001(\005\022\035\n\025num_ceiling_l" - "ights_on\030\013 \001(\005\022\033\n\023num_table_lights_on\030\014 " - "\001(\005\022\027\n\017entity_page_ids\030\r \003(\005\"\277\003\n\024NSPanel" - "WeatherUpdate\022:\n\016forecast_items\030\001 \003(\0132\"." - "NSPanelWeatherUpdate.ForecastItem\022\034\n\024cur" - "rent_weather_icon\030\002 \001(\t\022\"\n\032current_tempe" - "rature_string\030\003 \001(\t\022\"\n\032current_maxmin_te" - "mperature\030\004 \001(\t\022\033\n\023current_wind_string\030\005" - " \001(\t\022\026\n\016sunrise_string\030\006 \001(\t\022\025\n\rsunset_s" - "tring\030\007 \001(\t\022$\n\034current_precipitation_str" - "ing\030\010 \001(\t\032\222\001\n\014ForecastItem\022\024\n\014weather_ic" - "on\030\001 \001(\t\022\034\n\024precipitation_string\030\002 \001(\t\022!" - "\n\031temperature_maxmin_string\030\003 \001(\t\022\023\n\013win" - "d_string\030\004 \001(\t\022\026\n\016display_string\030\005 \001(\t\"\272" - "\020\n\031NSPanelMQTTManagerCommand\022M\n\022first_pa" - "ge_turn_on\030\001 \001(\0132/.NSPanelMQTTManagerCom" - "mand.FirstPageTurnLightOnH\000\022O\n\023first_pag" - "e_turn_off\030\002 \001(\01320.NSPanelMQTTManagerCom" - "mand.FirstPageTurnLightOffH\000\022@\n\rlight_co" - "mmand\030\003 \001(\0132\'.NSPanelMQTTManagerCommand." - "LightCommandH\000\022c\n toggle_entity_from_ent" - "ities_page\030\004 \001(\01327.NSPanelMQTTManagerCom" - "mand.ToggleEntityFromEntitiesPageH\000\022I\n\022s" - "ave_scene_command\030\005 \001(\0132+.NSPanelMQTTMan" - "agerCommand.SaveSceneCommandH\000\022B\n\016button" - "_pressed\030\006 \001(\0132(.NSPanelMQTTManagerComma" - "nd.ButtonPressedH\000\022a\n\036thermostat_tempera" - "ture_command\030\007 \001(\01327.NSPanelMQTTManagerC" - "ommand.ThermostatTemperatureCommandH\000\022J\n" - "\022thermostat_command\030\010 \001(\0132,.NSPanelMQTTM" - "anagerCommand.ThermostatCommandH\000\022M\n\024med" - "ia_player_command\030\t \001(\0132-.NSPanelMQTTMan" - "agerCommand.MediaPlayerCommandH\000\022\022\n\nnspa" - "nel_id\030d \001(\005\032\372\001\n\024FirstPageTurnLightOn\022E\n" - "\raffect_lights\030\001 \001(\0162..NSPanelMQTTManage" - "rCommand.AffectLightsOptions\022\037\n\027brightne" - "ss_slider_value\030\002 \001(\005\022\033\n\023kelvin_slider_v" - "alue\030\003 \001(\005\022\025\n\rselected_room\030\004 \001(\005\022\016\n\006glo" - "bal\030\005 \001(\010\022\034\n\024has_brightness_value\030\006 \001(\010\022" - "\030\n\020has_kelvin_value\030\007 \001(\010\032n\n\025FirstPageTu" - "rnLightOff\022E\n\raffect_lights\030\001 \001(\0162..NSPa" - "nelMQTTManagerCommand.AffectLightsOption" - "s\022\016\n\006global\030\002 \001(\010\032\321\001\n\014LightCommand\022\021\n\tli" - "ght_ids\030\001 \003(\005\022\026\n\016has_brightness\030\002 \001(\010\022\022\n" - "\nbrightness\030\003 \001(\005\022\035\n\025has_color_temperatu" - "re\030\004 \001(\010\022\031\n\021color_temperature\030\005 \001(\005\022\017\n\007h" - "as_hue\030\006 \001(\010\022\013\n\003hue\030\007 \001(\005\022\026\n\016has_saturat" - "ion\030\010 \001(\010\022\022\n\nsaturation\030\t \001(\005\032K\n\034ToggleE" - "ntityFromEntitiesPage\022\026\n\016entity_page_id\030" - "\001 \001(\005\022\023\n\013entity_slot\030\002 \001(\005\032\?\n\020SaveSceneC" - "ommand\022\026\n\016entity_page_id\030\001 \001(\005\022\023\n\013entity" - "_slot\030\002 \001(\005\032\"\n\rButtonPressed\022\021\n\tbutton_i" - "d\030\002 \001(\005\032J\n\034ThermostatTemperatureCommand\022" - "\025\n\rthermostat_id\030\001 \001(\005\022\023\n\013temperature\030\002 " - "\001(\002\032M\n\021ThermostatCommand\022\025\n\rthermostat_i" - "d\030\001 \001(\005\022\016\n\006option\030\002 \001(\t\022\021\n\tnew_value\030\003 \001" - "(\t\032\321\002\n\022MediaPlayerCommand\022\027\n\017media_playe" - "r_id\030\001 \001(\005\022U\n\017playback_action\030\002 \001(\0162<.NS" - "PanelMQTTManagerCommand.MediaPlayerComma" - "nd.PlaybackAction\022\022\n\nhas_volume\030\003 \001(\010\022\016\n" - "\006volume\030\004 \001(\005\022\031\n\021has_source_volume\030\005 \001(\010" - "\022\025\n\rsource_volume\030\006 \001(\005\022\021\n\thas_muted\030\007 \001" - "(\010\022\r\n\005muted\030\010 \001(\010\"S\n\016PlaybackAction\022\010\n\004N" - "ONE\020\000\022\010\n\004PLAY\020\001\022\t\n\005PAUSE\020\002\022\016\n\nNEXT_TRACK" - "\020\003\022\022\n\016PREVIOUS_TRACK\020\004\"D\n\023AffectLightsOp" - "tions\022\007\n\003ALL\020\000\022\020\n\014TABLE_LIGHTS\020\001\022\022\n\016CEIL" - "ING_LIGHTS\020\002B\r\n\013CommandData*[\n\023NSPanelWa" - "rningLevel\022\014\n\010CRITICAL\020\000\022\t\n\005ERROR\020\001\022\013\n\007W" - "ARNING\020\002\022\010\n\004INFO\020\003\022\t\n\005DEBUG\020\004\022\t\n\005TRACE\020\005" - "b\006proto3" + "ature\030, \001(\005\022$\n\006sounds\030- \003(\0132\024.NSPanelCon" + "fig.Sound\032L\n\010RoomInfo\022\017\n\007room_id\030\001 \001(\005\022\027" + "\n\017entity_page_ids\030\002 \003(\005\022\026\n\016scene_page_id" + "s\030\003 \003(\005\032G\n\005Sound\022/\n\005event\030\001 \001(\0162 .NSPane" + "lConfig.NSPanelSoundEvent\022\r\n\005rtttl\030\002 \001(\t" + "\"8\n\022NSPanelDefaultPage\022\010\n\004HOME\020\000\022\n\n\006SCEN" + "ES\020\001\022\014\n\010ENTITIES\020\002\"\250\001\n\026NSPanelScreensave" + "rMode\022\033\n\027WEATHER_WITH_BACKGROUND\020\000\022\036\n\032WE" + "ATHER_WITHOUT_BACKGROUND\020\001\022\034\n\030DATETIME_W" + "ITH_BACKGROUND\020\003\022\037\n\033DATETIME_WITHOUT_BAC" + "KGROUND\020\004\022\022\n\016NO_SCREENSAVER\020\005\"i\n\021NSPanel" + "ButtonMode\022\n\n\006DIRECT\020\000\022\n\n\006FOLLOW\020\001\022\022\n\016NO" + "TIFY_MANAGER\020\002\022\023\n\017THERMOSTAT_HEAT\020\003\022\023\n\017T" + "HERMOSTAT_COOL\020\004\"D\n\021NSPanelSoundEvent\022\t\n" + "\005TOUCH\020\000\022\023\n\017SCENE_ACTIVATED\020\001\022\017\n\013SCENE_S" + "AVED\020\002\"C\n\016NSPanelWarning\022#\n\005level\030\001 \001(\0162" + "\024.NSPanelWarningLevel\022\014\n\004text\030\002 \001(\t\"\351\003\n\023" + "NSPanelStatusReport\0221\n\rnspanel_state\030\001 \001" + "(\0162\032.NSPanelStatusReport.state\022\027\n\017update" + "_progress\030\002 \001(\005\022\014\n\004rssi\030\003 \001(\005\022\025\n\rheap_us" + "ed_pct\030\004 \001(\005\022\023\n\013mac_address\030\005 \001(\t\022\023\n\013tem" + "perature\030\006 \001(\002\022\022\n\nip_address\030\007 \001(\t\022!\n\010wa" + "rnings\030\010 \003(\0132\017.NSPanelWarning\022\024\n\014md5_fir" + "mware\030\t \001(\t\022\024\n\014md5_littlefs\030\n \001(\t\022\023\n\013md5" + "_tft_gui\030\013 \001(\t\022\024\n\014has_humidity\030\014 \001(\010\022\020\n\010" + "humidity\030\r \001(\002\022\024\n\014has_pressure\030\016 \001(\010\022\020\n\010" + "pressure\030\017 \001(\002\"o\n\005state\022\n\n\006ONLINE\020\000\022\013\n\007O" + "FFLINE\020\001\022\020\n\014UPDATING_TFT\020\002\022\025\n\021UPDATING_F" + "IRMWARE\020\003\022\025\n\021UPDATING_LITTLEFS\020\004\022\r\n\tREBO" + "OTING\020\005\"\246\004\n\027NSPanelRoomEntitiesPage\022\n\n\002i" + "d\030\001 \001(\005\022\021\n\tpage_type\030\002 \001(\005\022\023\n\013header_tex" + "t\030\003 \001(\t\0225\n\010entities\030\004 \003(\0132#.NSPanelRoomE" + "ntitiesPage.EntitySlot\032\237\003\n\nEntitySlot\022\032\n" + "\022room_view_position\030\001 \001(\005\022\014\n\004name\030\002 \001(\t\022" + "\014\n\004icon\030\003 \001(\t\022\013\n\003pco\030\004 \001(\005\022\014\n\004pco2\030\005 \001(\005" + "\022\026\n\016can_save_scene\030\006 \001(\010\022\030\n\020mqtt_state_t" + "opic\030\007 \001(\t\022<\n\004type\030\010 \001(\0162..NSPanelRoomEn" + "titiesPage.EntitySlot.EntityType\022\n\n\002id\030\t" + " \001(\005\"\301\001\n\nEntityType\022\033\n\027ENTITY_TYPE_UNSPE" + "CIFIED\020\000\022\025\n\021ENTITY_TYPE_LIGHT\020\001\022\026\n\022ENTIT" + "Y_TYPE_SWITCH\020\002\022\026\n\022ENTITY_TYPE_BUTTON\020\003\022" + "\032\n\026ENTITY_TYPE_THERMOSTAT\020\004\022\025\n\021ENTITY_TY" + "PE_SCENE\020\005\022\034\n\030ENTITY_TYPE_MEDIA_PLAYER\020\006" + "\"\226\003\n\021NSPanelRoomStatus\022\n\n\002id\030\001 \001(\005\022\014\n\004na" + "me\030\002 \001(\t\022\031\n\021average_dim_level\030\003 \001(\005\022 \n\030c" + "eiling_lights_dim_level\030\004 \001(\005\022\036\n\026table_l" + "ights_dim_level\030\005 \001(\005\022!\n\031average_color_t" + "emperature\030\006 \001(\005\022.\n&ceiling_lights_color" + "_temperature_value\030\007 \001(\005\022,\n$table_lights" + "_color_temperature_value\030\010 \001(\005\022\032\n\022num_ce" + "iling_lights\030\t \001(\005\022\030\n\020num_table_lights\030\n" + " \001(\005\022\035\n\025num_ceiling_lights_on\030\013 \001(\005\022\033\n\023n" + "um_table_lights_on\030\014 \001(\005\022\027\n\017entity_page_" + "ids\030\r \003(\005\"\277\003\n\024NSPanelWeatherUpdate\022:\n\016fo" + "recast_items\030\001 \003(\0132\".NSPanelWeatherUpdat" + "e.ForecastItem\022\034\n\024current_weather_icon\030\002" + " \001(\t\022\"\n\032current_temperature_string\030\003 \001(\t" + "\022\"\n\032current_maxmin_temperature\030\004 \001(\t\022\033\n\023" + "current_wind_string\030\005 \001(\t\022\026\n\016sunrise_str" + "ing\030\006 \001(\t\022\025\n\rsunset_string\030\007 \001(\t\022$\n\034curr" + "ent_precipitation_string\030\010 \001(\t\032\222\001\n\014Forec" + "astItem\022\024\n\014weather_icon\030\001 \001(\t\022\034\n\024precipi" + "tation_string\030\002 \001(\t\022!\n\031temperature_maxmi" + "n_string\030\003 \001(\t\022\023\n\013wind_string\030\004 \001(\t\022\026\n\016d" + "isplay_string\030\005 \001(\t\"\272\020\n\031NSPanelMQTTManag" + "erCommand\022M\n\022first_page_turn_on\030\001 \001(\0132/." + "NSPanelMQTTManagerCommand.FirstPageTurnL" + "ightOnH\000\022O\n\023first_page_turn_off\030\002 \001(\01320." + "NSPanelMQTTManagerCommand.FirstPageTurnL" + "ightOffH\000\022@\n\rlight_command\030\003 \001(\0132\'.NSPan" + "elMQTTManagerCommand.LightCommandH\000\022c\n t" + "oggle_entity_from_entities_page\030\004 \001(\01327." + "NSPanelMQTTManagerCommand.ToggleEntityFr" + "omEntitiesPageH\000\022I\n\022save_scene_command\030\005" + " \001(\0132+.NSPanelMQTTManagerCommand.SaveSce" + "neCommandH\000\022B\n\016button_pressed\030\006 \001(\0132(.NS" + "PanelMQTTManagerCommand.ButtonPressedH\000\022" + "a\n\036thermostat_temperature_command\030\007 \001(\0132" + "7.NSPanelMQTTManagerCommand.ThermostatTe" + "mperatureCommandH\000\022J\n\022thermostat_command" + "\030\010 \001(\0132,.NSPanelMQTTManagerCommand.Therm" + "ostatCommandH\000\022M\n\024media_player_command\030\t" + " \001(\0132-.NSPanelMQTTManagerCommand.MediaPl" + "ayerCommandH\000\022\022\n\nnspanel_id\030d \001(\005\032\372\001\n\024Fi" + "rstPageTurnLightOn\022E\n\raffect_lights\030\001 \001(" + "\0162..NSPanelMQTTManagerCommand.AffectLigh" + "tsOptions\022\037\n\027brightness_slider_value\030\002 \001" + "(\005\022\033\n\023kelvin_slider_value\030\003 \001(\005\022\025\n\rselec" + "ted_room\030\004 \001(\005\022\016\n\006global\030\005 \001(\010\022\034\n\024has_br" + "ightness_value\030\006 \001(\010\022\030\n\020has_kelvin_value" + "\030\007 \001(\010\032n\n\025FirstPageTurnLightOff\022E\n\raffec" + "t_lights\030\001 \001(\0162..NSPanelMQTTManagerComma" + "nd.AffectLightsOptions\022\016\n\006global\030\002 \001(\010\032\321" + "\001\n\014LightCommand\022\021\n\tlight_ids\030\001 \003(\005\022\026\n\016ha" + "s_brightness\030\002 \001(\010\022\022\n\nbrightness\030\003 \001(\005\022\035" + "\n\025has_color_temperature\030\004 \001(\010\022\031\n\021color_t" + "emperature\030\005 \001(\005\022\017\n\007has_hue\030\006 \001(\010\022\013\n\003hue" + "\030\007 \001(\005\022\026\n\016has_saturation\030\010 \001(\010\022\022\n\nsatura" + "tion\030\t \001(\005\032K\n\034ToggleEntityFromEntitiesPa" + "ge\022\026\n\016entity_page_id\030\001 \001(\005\022\023\n\013entity_slo" + "t\030\002 \001(\005\032\?\n\020SaveSceneCommand\022\026\n\016entity_pa" + "ge_id\030\001 \001(\005\022\023\n\013entity_slot\030\002 \001(\005\032\"\n\rButt" + "onPressed\022\021\n\tbutton_id\030\002 \001(\005\032J\n\034Thermost" + "atTemperatureCommand\022\025\n\rthermostat_id\030\001 " + "\001(\005\022\023\n\013temperature\030\002 \001(\002\032M\n\021ThermostatCo" + "mmand\022\025\n\rthermostat_id\030\001 \001(\005\022\016\n\006option\030\002" + " \001(\t\022\021\n\tnew_value\030\003 \001(\t\032\321\002\n\022MediaPlayerC" + "ommand\022\027\n\017media_player_id\030\001 \001(\005\022U\n\017playb" + "ack_action\030\002 \001(\0162<.NSPanelMQTTManagerCom" + "mand.MediaPlayerCommand.PlaybackAction\022\022" + "\n\nhas_volume\030\003 \001(\010\022\016\n\006volume\030\004 \001(\005\022\031\n\021ha" + "s_source_volume\030\005 \001(\010\022\025\n\rsource_volume\030\006" + " \001(\005\022\021\n\thas_muted\030\007 \001(\010\022\r\n\005muted\030\010 \001(\010\"S" + "\n\016PlaybackAction\022\010\n\004NONE\020\000\022\010\n\004PLAY\020\001\022\t\n\005" + "PAUSE\020\002\022\016\n\nNEXT_TRACK\020\003\022\022\n\016PREVIOUS_TRAC" + "K\020\004\"D\n\023AffectLightsOptions\022\007\n\003ALL\020\000\022\020\n\014T" + "ABLE_LIGHTS\020\001\022\022\n\016CEILING_LIGHTS\020\002B\r\n\013Com" + "mandData*[\n\023NSPanelWarningLevel\022\014\n\010CRITI" + "CAL\020\000\022\t\n\005ERROR\020\001\022\013\n\007WARNING\020\002\022\010\n\004INFO\020\003\022" + "\t\n\005DEBUG\020\004\022\t\n\005TRACE\020\005b\006proto3" }; static ::absl::once_flag descriptor_table_protobuf_5fnspanel_2eproto_once; PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_protobuf_5fnspanel_2eproto = { false, false, - 5888, + 6069, descriptor_table_protodef_protobuf_5fnspanel_2eproto, "protobuf_nspanel.proto", &descriptor_table_protobuf_5fnspanel_2eproto_once, nullptr, 0, - 19, + 20, schemas, file_default_instances, TableStruct_protobuf_5fnspanel_2eproto::offsets, @@ -1140,10 +1180,31 @@ constexpr int NSPanelConfig::NSPanelButtonMode_ARRAYSIZE; #endif // (__cplusplus < 201703) && // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::google::protobuf::EnumDescriptor* NSPanelStatusReport_state_descriptor() { +const ::google::protobuf::EnumDescriptor* NSPanelConfig_NSPanelSoundEvent_descriptor() { ::google::protobuf::internal::AssignDescriptors(&descriptor_table_protobuf_5fnspanel_2eproto); return file_level_enum_descriptors_protobuf_5fnspanel_2eproto[3]; } +PROTOBUF_CONSTINIT const uint32_t NSPanelConfig_NSPanelSoundEvent_internal_data_[] = { + 196608u, 0u, }; +bool NSPanelConfig_NSPanelSoundEvent_IsValid(int value) { + return 0 <= value && value <= 2; +} +#if (__cplusplus < 201703) && \ + (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) + +constexpr NSPanelConfig_NSPanelSoundEvent NSPanelConfig::TOUCH; +constexpr NSPanelConfig_NSPanelSoundEvent NSPanelConfig::SCENE_ACTIVATED; +constexpr NSPanelConfig_NSPanelSoundEvent NSPanelConfig::SCENE_SAVED; +constexpr NSPanelConfig_NSPanelSoundEvent NSPanelConfig::NSPanelSoundEvent_MIN; +constexpr NSPanelConfig_NSPanelSoundEvent NSPanelConfig::NSPanelSoundEvent_MAX; +constexpr int NSPanelConfig::NSPanelSoundEvent_ARRAYSIZE; + +#endif // (__cplusplus < 201703) && + // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::google::protobuf::EnumDescriptor* NSPanelStatusReport_state_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_protobuf_5fnspanel_2eproto); + return file_level_enum_descriptors_protobuf_5fnspanel_2eproto[4]; +} PROTOBUF_CONSTINIT const uint32_t NSPanelStatusReport_state_internal_data_[] = { 393216u, 0u, }; bool NSPanelStatusReport_state_IsValid(int value) { @@ -1166,7 +1227,7 @@ constexpr int NSPanelStatusReport::state_ARRAYSIZE; // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::google::protobuf::EnumDescriptor* NSPanelRoomEntitiesPage_EntitySlot_EntityType_descriptor() { ::google::protobuf::internal::AssignDescriptors(&descriptor_table_protobuf_5fnspanel_2eproto); - return file_level_enum_descriptors_protobuf_5fnspanel_2eproto[4]; + return file_level_enum_descriptors_protobuf_5fnspanel_2eproto[5]; } PROTOBUF_CONSTINIT const uint32_t NSPanelRoomEntitiesPage_EntitySlot_EntityType_internal_data_[] = { 458752u, 0u, }; @@ -1191,7 +1252,7 @@ constexpr int NSPanelRoomEntitiesPage_EntitySlot::EntityType_ARRAYSIZE; // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::google::protobuf::EnumDescriptor* NSPanelMQTTManagerCommand_MediaPlayerCommand_PlaybackAction_descriptor() { ::google::protobuf::internal::AssignDescriptors(&descriptor_table_protobuf_5fnspanel_2eproto); - return file_level_enum_descriptors_protobuf_5fnspanel_2eproto[5]; + return file_level_enum_descriptors_protobuf_5fnspanel_2eproto[6]; } PROTOBUF_CONSTINIT const uint32_t NSPanelMQTTManagerCommand_MediaPlayerCommand_PlaybackAction_internal_data_[] = { 327680u, 0u, }; @@ -1214,7 +1275,7 @@ constexpr int NSPanelMQTTManagerCommand_MediaPlayerCommand::PlaybackAction_ARRAY // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::google::protobuf::EnumDescriptor* NSPanelMQTTManagerCommand_AffectLightsOptions_descriptor() { ::google::protobuf::internal::AssignDescriptors(&descriptor_table_protobuf_5fnspanel_2eproto); - return file_level_enum_descriptors_protobuf_5fnspanel_2eproto[6]; + return file_level_enum_descriptors_protobuf_5fnspanel_2eproto[7]; } PROTOBUF_CONSTINIT const uint32_t NSPanelMQTTManagerCommand_AffectLightsOptions_internal_data_[] = { 196608u, 0u, }; @@ -1235,7 +1296,7 @@ constexpr int NSPanelMQTTManagerCommand::AffectLightsOptions_ARRAYSIZE; // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::google::protobuf::EnumDescriptor* NSPanelWarningLevel_descriptor() { ::google::protobuf::internal::AssignDescriptors(&descriptor_table_protobuf_5fnspanel_2eproto); - return file_level_enum_descriptors_protobuf_5fnspanel_2eproto[7]; + return file_level_enum_descriptors_protobuf_5fnspanel_2eproto[8]; } PROTOBUF_CONSTINIT const uint32_t NSPanelWarningLevel_internal_data_[] = { 393216u, 0u, }; @@ -1501,6 +1562,225 @@ ::google::protobuf::Metadata NSPanelConfig_RoomInfo::GetMetadata() const { } // =================================================================== +class NSPanelConfig_Sound::_Internal { + public: +}; + +NSPanelConfig_Sound::NSPanelConfig_Sound(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:NSPanelConfig.Sound) +} +inline PROTOBUF_NDEBUG_INLINE NSPanelConfig_Sound::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, + const Impl_& from, const ::NSPanelConfig_Sound& from_msg) + : rtttl_(arena, from.rtttl_), + _cached_size_{0} {} + +NSPanelConfig_Sound::NSPanelConfig_Sound( + ::google::protobuf::Arena* arena, + const NSPanelConfig_Sound& from) + : ::google::protobuf::Message(arena) { + NSPanelConfig_Sound* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.event_ = from._impl_.event_; + + // @@protoc_insertion_point(copy_constructor:NSPanelConfig.Sound) +} +inline PROTOBUF_NDEBUG_INLINE NSPanelConfig_Sound::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena) + : rtttl_(arena), + _cached_size_{0} {} + +inline void NSPanelConfig_Sound::SharedCtor(::_pb::Arena* arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.event_ = {}; +} +NSPanelConfig_Sound::~NSPanelConfig_Sound() { + // @@protoc_insertion_point(destructor:NSPanelConfig.Sound) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void NSPanelConfig_Sound::SharedDtor() { + ABSL_DCHECK(GetArena() == nullptr); + _impl_.rtttl_.Destroy(); + _impl_.~Impl_(); +} + +const ::google::protobuf::MessageLite::ClassData* +NSPanelConfig_Sound::GetClassData() const { + PROTOBUF_CONSTINIT static const ::google::protobuf::MessageLite:: + ClassDataFull _data_ = { + { + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + PROTOBUF_FIELD_OFFSET(NSPanelConfig_Sound, _impl_._cached_size_), + false, + }, + &NSPanelConfig_Sound::MergeImpl, + &NSPanelConfig_Sound::kDescriptorMethods, + &descriptor_table_protobuf_5fnspanel_2eproto, + nullptr, // tracker + }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); + return _data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 0, 33, 2> NSPanelConfig_Sound::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_NSPanelConfig_Sound_default_instance_._instance, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::NSPanelConfig_Sound>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // string rtttl = 2; + {::_pbi::TcParser::FastUS1, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig_Sound, _impl_.rtttl_)}}, + // .NSPanelConfig.NSPanelSoundEvent event = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(NSPanelConfig_Sound, _impl_.event_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig_Sound, _impl_.event_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // .NSPanelConfig.NSPanelSoundEvent event = 1; + {PROTOBUF_FIELD_OFFSET(NSPanelConfig_Sound, _impl_.event_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // string rtttl = 2; + {PROTOBUF_FIELD_OFFSET(NSPanelConfig_Sound, _impl_.rtttl_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\23\0\5\0\0\0\0\0" + "NSPanelConfig.Sound" + "rtttl" + }}, +}; + +PROTOBUF_NOINLINE void NSPanelConfig_Sound::Clear() { +// @@protoc_insertion_point(message_clear_start:NSPanelConfig.Sound) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.rtttl_.ClearToEmpty(); + _impl_.event_ = 0; + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +::uint8_t* NSPanelConfig_Sound::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:NSPanelConfig.Sound) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // .NSPanelConfig.NSPanelSoundEvent event = 1; + if (this->_internal_event() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_event(), target); + } + + // string rtttl = 2; + if (!this->_internal_rtttl().empty()) { + const std::string& _s = this->_internal_rtttl(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "NSPanelConfig.Sound.rtttl"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:NSPanelConfig.Sound) + return target; +} + +::size_t NSPanelConfig_Sound::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:NSPanelConfig.Sound) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(reinterpret_cast(this)); + // string rtttl = 2; + if (!this->_internal_rtttl().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_rtttl()); + } + + // .NSPanelConfig.NSPanelSoundEvent event = 1; + if (this->_internal_event() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_event()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + + +void NSPanelConfig_Sound::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:NSPanelConfig.Sound) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_rtttl().empty()) { + _this->_internal_set_rtttl(from._internal_rtttl()); + } + if (from._internal_event() != 0) { + _this->_impl_.event_ = from._impl_.event_; + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void NSPanelConfig_Sound::CopyFrom(const NSPanelConfig_Sound& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:NSPanelConfig.Sound) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void NSPanelConfig_Sound::InternalSwap(NSPanelConfig_Sound* PROTOBUF_RESTRICT other) { + using std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.rtttl_, &other->_impl_.rtttl_, arena); + swap(_impl_.event_, other->_impl_.event_); +} + +::google::protobuf::Metadata NSPanelConfig_Sound::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + class NSPanelConfig::_Internal { public: }; @@ -1520,6 +1800,7 @@ inline PROTOBUF_NDEBUG_INLINE NSPanelConfig::Impl_::Impl_( _relay1_relay_group_cached_byte_size_{0}, relay2_relay_group_{visibility, arena, from.relay2_relay_group_}, _relay2_relay_group_cached_byte_size_{0}, + sounds_{visibility, arena, from.sounds_}, name_(arena, from.name_), inside_temperature_sensor_mqtt_topic_(arena, from.inside_temperature_sensor_mqtt_topic_), _cached_size_{0} {} @@ -1553,6 +1834,7 @@ inline PROTOBUF_NDEBUG_INLINE NSPanelConfig::Impl_::Impl_( _relay1_relay_group_cached_byte_size_{0}, relay2_relay_group_{visibility, arena}, _relay2_relay_group_cached_byte_size_{0}, + sounds_{visibility, arena}, name_(arena), inside_temperature_sensor_mqtt_topic_(arena), _cached_size_{0} {} @@ -1599,16 +1881,16 @@ NSPanelConfig::GetClassData() const { return _data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<5, 36, 1, 94, 7> NSPanelConfig::_table_ = { +const ::_pbi::TcParseTable<5, 37, 2, 94, 7> NSPanelConfig::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 44, 248, // max_field_number, fast_idx_mask + 45, 248, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), 515899392, // skipmap offsetof(decltype(_table_), field_entries), - 36, // num_field_entries - 1, // num_aux_entries + 37, // num_field_entries + 2, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_NSPanelConfig_default_instance_._instance, nullptr, // post_loop_handler @@ -1702,7 +1984,9 @@ const ::_pbi::TcParseTable<5, 36, 1, 94, 7> NSPanelConfig::_table_ = { // int32 button2_upper_temperature = 44; {::_pbi::TcParser::FastV32S2, {736, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button2_upper_temperature_)}}, - {::_pbi::TcParser::MiniParse, {}}, + // repeated .NSPanelConfig.Sound sounds = 45; + {::_pbi::TcParser::FastMtR2, + {746, 63, 1, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.sounds_)}}, // repeated int32 global_scene_entity_page_ids = 30; {::_pbi::TcParser::FastV32P2, {498, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.global_scene_entity_page_ids_)}}, @@ -1711,7 +1995,7 @@ const ::_pbi::TcParseTable<5, 36, 1, 94, 7> NSPanelConfig::_table_ = { {504, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.optimistic_mode_)}}, }}, {{ 33, 0, 1, - 61450, 26, + 57354, 26, 65535, 65535 }}, {{ // string name = 1; @@ -1822,8 +2106,12 @@ const ::_pbi::TcParseTable<5, 36, 1, 94, 7> NSPanelConfig::_table_ = { // int32 button2_upper_temperature = 44; {PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button2_upper_temperature_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kInt32)}, + // repeated .NSPanelConfig.Sound sounds = 45; + {PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.sounds_), 0, 1, + (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ {::_pbi::TcParser::GetTable<::NSPanelConfig_RoomInfo>()}, + {::_pbi::TcParser::GetTable<::NSPanelConfig_Sound>()}, }}, {{ "\15\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\44\0\0\0\0\0\0\0" "NSPanelConfig" @@ -1843,6 +2131,7 @@ PROTOBUF_NOINLINE void NSPanelConfig::Clear() { _impl_.global_scene_entity_page_ids_.Clear(); _impl_.relay1_relay_group_.Clear(); _impl_.relay2_relay_group_.Clear(); + _impl_.sounds_.Clear(); _impl_.name_.ClearToEmpty(); _impl_.inside_temperature_sensor_mqtt_topic_.ClearToEmpty(); ::memset(&_impl_.default_room_, 0, static_cast<::size_t>( @@ -2122,6 +2411,17 @@ ::uint8_t* NSPanelConfig::_InternalSerialize( 44, this->_internal_button2_upper_temperature(), target); } + // repeated .NSPanelConfig.Sound sounds = 45; + for (unsigned i = 0, n = static_cast( + this->_internal_sounds_size()); + i < n; i++) { + const auto& repfield = this->_internal_sounds().Get(i); + target = + ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 45, repfield, repfield.GetCachedSize(), + target, stream); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( @@ -2184,6 +2484,11 @@ ::size_t NSPanelConfig::ByteSizeLong() const { ; total_size += tag_size + data_size; } + // repeated .NSPanelConfig.Sound sounds = 45; + total_size += 2UL * this->_internal_sounds_size(); + for (const auto& msg : this->_internal_sounds()) { + total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } // string name = 1; if (!this->_internal_name().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( @@ -2383,6 +2688,8 @@ void NSPanelConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::g _this->_internal_mutable_global_scene_entity_page_ids()->MergeFrom(from._internal_global_scene_entity_page_ids()); _this->_internal_mutable_relay1_relay_group()->MergeFrom(from._internal_relay1_relay_group()); _this->_internal_mutable_relay2_relay_group()->MergeFrom(from._internal_relay2_relay_group()); + _this->_internal_mutable_sounds()->MergeFrom( + from._internal_sounds()); if (!from._internal_name().empty()) { _this->_internal_set_name(from._internal_name()); } @@ -2499,6 +2806,7 @@ void NSPanelConfig::InternalSwap(NSPanelConfig* PROTOBUF_RESTRICT other) { _impl_.global_scene_entity_page_ids_.InternalSwap(&other->_impl_.global_scene_entity_page_ids_); _impl_.relay1_relay_group_.InternalSwap(&other->_impl_.relay1_relay_group_); _impl_.relay2_relay_group_.InternalSwap(&other->_impl_.relay2_relay_group_); + _impl_.sounds_.InternalSwap(&other->_impl_.sounds_); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.name_, &other->_impl_.name_, arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.inside_temperature_sensor_mqtt_topic_, &other->_impl_.inside_temperature_sensor_mqtt_topic_, arena); ::google::protobuf::internal::memswap< diff --git a/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.h b/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.h index 2c49774b..887ad042 100644 --- a/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.h +++ b/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.h @@ -56,6 +56,9 @@ extern NSPanelConfigDefaultTypeInternal _NSPanelConfig_default_instance_; class NSPanelConfig_RoomInfo; struct NSPanelConfig_RoomInfoDefaultTypeInternal; extern NSPanelConfig_RoomInfoDefaultTypeInternal _NSPanelConfig_RoomInfo_default_instance_; +class NSPanelConfig_Sound; +struct NSPanelConfig_SoundDefaultTypeInternal; +extern NSPanelConfig_SoundDefaultTypeInternal _NSPanelConfig_Sound_default_instance_; class NSPanelMQTTManagerCommand; struct NSPanelMQTTManagerCommandDefaultTypeInternal; extern NSPanelMQTTManagerCommandDefaultTypeInternal _NSPanelMQTTManagerCommand_default_instance_; @@ -218,6 +221,40 @@ inline bool NSPanelConfig_NSPanelButtonMode_Parse(absl::string_view name, NSPane return ::google::protobuf::internal::ParseNamedEnum( NSPanelConfig_NSPanelButtonMode_descriptor(), name, value); } +enum NSPanelConfig_NSPanelSoundEvent : int { + NSPanelConfig_NSPanelSoundEvent_TOUCH = 0, + NSPanelConfig_NSPanelSoundEvent_SCENE_ACTIVATED = 1, + NSPanelConfig_NSPanelSoundEvent_SCENE_SAVED = 2, + NSPanelConfig_NSPanelSoundEvent_NSPanelConfig_NSPanelSoundEvent_INT_MIN_SENTINEL_DO_NOT_USE_ = + std::numeric_limits<::int32_t>::min(), + NSPanelConfig_NSPanelSoundEvent_NSPanelConfig_NSPanelSoundEvent_INT_MAX_SENTINEL_DO_NOT_USE_ = + std::numeric_limits<::int32_t>::max(), +}; + +bool NSPanelConfig_NSPanelSoundEvent_IsValid(int value); +extern const uint32_t NSPanelConfig_NSPanelSoundEvent_internal_data_[]; +constexpr NSPanelConfig_NSPanelSoundEvent NSPanelConfig_NSPanelSoundEvent_NSPanelSoundEvent_MIN = static_cast(0); +constexpr NSPanelConfig_NSPanelSoundEvent NSPanelConfig_NSPanelSoundEvent_NSPanelSoundEvent_MAX = static_cast(2); +constexpr int NSPanelConfig_NSPanelSoundEvent_NSPanelSoundEvent_ARRAYSIZE = 2 + 1; +const ::google::protobuf::EnumDescriptor* +NSPanelConfig_NSPanelSoundEvent_descriptor(); +template +const std::string& NSPanelConfig_NSPanelSoundEvent_Name(T value) { + static_assert(std::is_same::value || + std::is_integral::value, + "Incorrect type passed to NSPanelSoundEvent_Name()."); + return NSPanelConfig_NSPanelSoundEvent_Name(static_cast(value)); +} +template <> +inline const std::string& NSPanelConfig_NSPanelSoundEvent_Name(NSPanelConfig_NSPanelSoundEvent value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool NSPanelConfig_NSPanelSoundEvent_Parse(absl::string_view name, NSPanelConfig_NSPanelSoundEvent* value) { + return ::google::protobuf::internal::ParseNamedEnum( + NSPanelConfig_NSPanelSoundEvent_descriptor(), name, value); +} enum NSPanelStatusReport_state : int { NSPanelStatusReport_state_ONLINE = 0, NSPanelStatusReport_state_OFFLINE = 1, @@ -461,7 +498,7 @@ class NSPanelWeatherUpdate_ForecastItem final : public ::google::protobuf::Messa return reinterpret_cast( &_NSPanelWeatherUpdate_ForecastItem_default_instance_); } - static constexpr int kIndexInFileMessages = 7; + static constexpr int kIndexInFileMessages = 8; friend void swap(NSPanelWeatherUpdate_ForecastItem& a, NSPanelWeatherUpdate_ForecastItem& b) { a.Swap(&b); } inline void Swap(NSPanelWeatherUpdate_ForecastItem* other) { if (other == this) return; @@ -710,7 +747,7 @@ class NSPanelWarning final : public ::google::protobuf::Message return reinterpret_cast( &_NSPanelWarning_default_instance_); } - static constexpr int kIndexInFileMessages = 2; + static constexpr int kIndexInFileMessages = 3; friend void swap(NSPanelWarning& a, NSPanelWarning& b) { a.Swap(&b); } inline void Swap(NSPanelWarning* other) { if (other == this) return; @@ -899,7 +936,7 @@ class NSPanelRoomStatus final : public ::google::protobuf::Message return reinterpret_cast( &_NSPanelRoomStatus_default_instance_); } - static constexpr int kIndexInFileMessages = 6; + static constexpr int kIndexInFileMessages = 7; friend void swap(NSPanelRoomStatus& a, NSPanelRoomStatus& b) { a.Swap(&b); } inline void Swap(NSPanelRoomStatus* other) { if (other == this) return; @@ -1229,7 +1266,7 @@ class NSPanelRoomEntitiesPage_EntitySlot final : public ::google::protobuf::Mess return reinterpret_cast( &_NSPanelRoomEntitiesPage_EntitySlot_default_instance_); } - static constexpr int kIndexInFileMessages = 4; + static constexpr int kIndexInFileMessages = 5; friend void swap(NSPanelRoomEntitiesPage_EntitySlot& a, NSPanelRoomEntitiesPage_EntitySlot& b) { a.Swap(&b); } inline void Swap(NSPanelRoomEntitiesPage_EntitySlot* other) { if (other == this) return; @@ -1538,7 +1575,7 @@ class NSPanelMQTTManagerCommand_ToggleEntityFromEntitiesPage final : public ::go return reinterpret_cast( &_NSPanelMQTTManagerCommand_ToggleEntityFromEntitiesPage_default_instance_); } - static constexpr int kIndexInFileMessages = 12; + static constexpr int kIndexInFileMessages = 13; friend void swap(NSPanelMQTTManagerCommand_ToggleEntityFromEntitiesPage& a, NSPanelMQTTManagerCommand_ToggleEntityFromEntitiesPage& b) { a.Swap(&b); } inline void Swap(NSPanelMQTTManagerCommand_ToggleEntityFromEntitiesPage* other) { if (other == this) return; @@ -1721,7 +1758,7 @@ class NSPanelMQTTManagerCommand_ThermostatTemperatureCommand final : public ::go return reinterpret_cast( &_NSPanelMQTTManagerCommand_ThermostatTemperatureCommand_default_instance_); } - static constexpr int kIndexInFileMessages = 15; + static constexpr int kIndexInFileMessages = 16; friend void swap(NSPanelMQTTManagerCommand_ThermostatTemperatureCommand& a, NSPanelMQTTManagerCommand_ThermostatTemperatureCommand& b) { a.Swap(&b); } inline void Swap(NSPanelMQTTManagerCommand_ThermostatTemperatureCommand* other) { if (other == this) return; @@ -1904,7 +1941,7 @@ class NSPanelMQTTManagerCommand_ThermostatCommand final : public ::google::proto return reinterpret_cast( &_NSPanelMQTTManagerCommand_ThermostatCommand_default_instance_); } - static constexpr int kIndexInFileMessages = 16; + static constexpr int kIndexInFileMessages = 17; friend void swap(NSPanelMQTTManagerCommand_ThermostatCommand& a, NSPanelMQTTManagerCommand_ThermostatCommand& b) { a.Swap(&b); } inline void Swap(NSPanelMQTTManagerCommand_ThermostatCommand* other) { if (other == this) return; @@ -2111,7 +2148,7 @@ class NSPanelMQTTManagerCommand_SaveSceneCommand final : public ::google::protob return reinterpret_cast( &_NSPanelMQTTManagerCommand_SaveSceneCommand_default_instance_); } - static constexpr int kIndexInFileMessages = 13; + static constexpr int kIndexInFileMessages = 14; friend void swap(NSPanelMQTTManagerCommand_SaveSceneCommand& a, NSPanelMQTTManagerCommand_SaveSceneCommand& b) { a.Swap(&b); } inline void Swap(NSPanelMQTTManagerCommand_SaveSceneCommand* other) { if (other == this) return; @@ -2294,7 +2331,7 @@ class NSPanelMQTTManagerCommand_MediaPlayerCommand final : public ::google::prot return reinterpret_cast( &_NSPanelMQTTManagerCommand_MediaPlayerCommand_default_instance_); } - static constexpr int kIndexInFileMessages = 17; + static constexpr int kIndexInFileMessages = 18; friend void swap(NSPanelMQTTManagerCommand_MediaPlayerCommand& a, NSPanelMQTTManagerCommand_MediaPlayerCommand& b) { a.Swap(&b); } inline void Swap(NSPanelMQTTManagerCommand_MediaPlayerCommand* other) { if (other == this) return; @@ -2571,7 +2608,7 @@ class NSPanelMQTTManagerCommand_LightCommand final : public ::google::protobuf:: return reinterpret_cast( &_NSPanelMQTTManagerCommand_LightCommand_default_instance_); } - static constexpr int kIndexInFileMessages = 11; + static constexpr int kIndexInFileMessages = 12; friend void swap(NSPanelMQTTManagerCommand_LightCommand& a, NSPanelMQTTManagerCommand_LightCommand& b) { a.Swap(&b); } inline void Swap(NSPanelMQTTManagerCommand_LightCommand* other) { if (other == this) return; @@ -2847,7 +2884,7 @@ class NSPanelMQTTManagerCommand_FirstPageTurnLightOn final : public ::google::pr return reinterpret_cast( &_NSPanelMQTTManagerCommand_FirstPageTurnLightOn_default_instance_); } - static constexpr int kIndexInFileMessages = 9; + static constexpr int kIndexInFileMessages = 10; friend void swap(NSPanelMQTTManagerCommand_FirstPageTurnLightOn& a, NSPanelMQTTManagerCommand_FirstPageTurnLightOn& b) { a.Swap(&b); } inline void Swap(NSPanelMQTTManagerCommand_FirstPageTurnLightOn* other) { if (other == this) return; @@ -3090,7 +3127,7 @@ class NSPanelMQTTManagerCommand_FirstPageTurnLightOff final : public ::google::p return reinterpret_cast( &_NSPanelMQTTManagerCommand_FirstPageTurnLightOff_default_instance_); } - static constexpr int kIndexInFileMessages = 10; + static constexpr int kIndexInFileMessages = 11; friend void swap(NSPanelMQTTManagerCommand_FirstPageTurnLightOff& a, NSPanelMQTTManagerCommand_FirstPageTurnLightOff& b) { a.Swap(&b); } inline void Swap(NSPanelMQTTManagerCommand_FirstPageTurnLightOff* other) { if (other == this) return; @@ -3273,7 +3310,7 @@ class NSPanelMQTTManagerCommand_ButtonPressed final : public ::google::protobuf: return reinterpret_cast( &_NSPanelMQTTManagerCommand_ButtonPressed_default_instance_); } - static constexpr int kIndexInFileMessages = 14; + static constexpr int kIndexInFileMessages = 15; friend void swap(NSPanelMQTTManagerCommand_ButtonPressed& a, NSPanelMQTTManagerCommand_ButtonPressed& b) { a.Swap(&b); } inline void Swap(NSPanelMQTTManagerCommand_ButtonPressed* other) { if (other == this) return; @@ -3389,6 +3426,195 @@ class NSPanelMQTTManagerCommand_ButtonPressed final : public ::google::protobuf: }; // ------------------------------------------------------------------- +class NSPanelConfig_Sound final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:NSPanelConfig.Sound) */ { + public: + inline NSPanelConfig_Sound() : NSPanelConfig_Sound(nullptr) {} + ~NSPanelConfig_Sound() override; + template + explicit PROTOBUF_CONSTEXPR NSPanelConfig_Sound( + ::google::protobuf::internal::ConstantInitialized); + + inline NSPanelConfig_Sound(const NSPanelConfig_Sound& from) : NSPanelConfig_Sound(nullptr, from) {} + inline NSPanelConfig_Sound(NSPanelConfig_Sound&& from) noexcept + : NSPanelConfig_Sound(nullptr, std::move(from)) {} + inline NSPanelConfig_Sound& operator=(const NSPanelConfig_Sound& from) { + CopyFrom(from); + return *this; + } + inline NSPanelConfig_Sound& operator=(NSPanelConfig_Sound&& from) noexcept { + if (this == &from) return *this; + if (GetArena() == from.GetArena() +#ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetArena() != nullptr +#endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const NSPanelConfig_Sound& default_instance() { + return *internal_default_instance(); + } + static inline const NSPanelConfig_Sound* internal_default_instance() { + return reinterpret_cast( + &_NSPanelConfig_Sound_default_instance_); + } + static constexpr int kIndexInFileMessages = 1; + friend void swap(NSPanelConfig_Sound& a, NSPanelConfig_Sound& b) { a.Swap(&b); } + inline void Swap(NSPanelConfig_Sound* other) { + if (other == this) return; +#ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() != nullptr && GetArena() == other->GetArena()) { +#else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { +#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(NSPanelConfig_Sound* other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + NSPanelConfig_Sound* New(::google::protobuf::Arena* arena = nullptr) const final { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const NSPanelConfig_Sound& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const NSPanelConfig_Sound& from) { NSPanelConfig_Sound::MergeImpl(*this, from); } + + private: + static void MergeImpl( + ::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() final; + ::size_t ByteSizeLong() const final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void InternalSwap(NSPanelConfig_Sound* other); + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { return "NSPanelConfig.Sound"; } + + protected: + explicit NSPanelConfig_Sound(::google::protobuf::Arena* arena); + NSPanelConfig_Sound(::google::protobuf::Arena* arena, const NSPanelConfig_Sound& from); + NSPanelConfig_Sound(::google::protobuf::Arena* arena, NSPanelConfig_Sound&& from) noexcept + : NSPanelConfig_Sound(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::Message::ClassData* GetClassData() const final; + + public: + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kRtttlFieldNumber = 2, + kEventFieldNumber = 1, + }; + // string rtttl = 2; + void clear_rtttl() ; + const std::string& rtttl() const; + template + void set_rtttl(Arg_&& arg, Args_... args); + std::string* mutable_rtttl(); + PROTOBUF_NODISCARD std::string* release_rtttl(); + void set_allocated_rtttl(std::string* value); + + private: + const std::string& _internal_rtttl() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_rtttl( + const std::string& value); + std::string* _internal_mutable_rtttl(); + + public: + // .NSPanelConfig.NSPanelSoundEvent event = 1; + void clear_event() ; + ::NSPanelConfig_NSPanelSoundEvent event() const; + void set_event(::NSPanelConfig_NSPanelSoundEvent value); + + private: + ::NSPanelConfig_NSPanelSoundEvent _internal_event() const; + void _internal_set_event(::NSPanelConfig_NSPanelSoundEvent value); + + public: + // @@protoc_insertion_point(class_scope:NSPanelConfig.Sound) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable< + 1, 2, 0, + 33, 2> + _table_; + + static constexpr const void* _raw_default_instance_ = + &_NSPanelConfig_Sound_default_instance_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_( + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena); + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena, const Impl_& from, + const NSPanelConfig_Sound& from_msg); + ::google::protobuf::internal::ArenaStringPtr rtttl_; + int event_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_protobuf_5fnspanel_2eproto; +}; +// ------------------------------------------------------------------- + class NSPanelConfig_RoomInfo final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:NSPanelConfig.RoomInfo) */ { public: @@ -3657,7 +3883,7 @@ class NSPanelWeatherUpdate final : public ::google::protobuf::Message return reinterpret_cast( &_NSPanelWeatherUpdate_default_instance_); } - static constexpr int kIndexInFileMessages = 8; + static constexpr int kIndexInFileMessages = 9; friend void swap(NSPanelWeatherUpdate& a, NSPanelWeatherUpdate& b) { a.Swap(&b); } inline void Swap(NSPanelWeatherUpdate* other) { if (other == this) return; @@ -3962,7 +4188,7 @@ class NSPanelStatusReport final : public ::google::protobuf::Message return reinterpret_cast( &_NSPanelStatusReport_default_instance_); } - static constexpr int kIndexInFileMessages = 3; + static constexpr int kIndexInFileMessages = 4; friend void swap(NSPanelStatusReport& a, NSPanelStatusReport& b) { a.Swap(&b); } inline void Swap(NSPanelStatusReport* other) { if (other == this) return; @@ -4361,7 +4587,7 @@ class NSPanelRoomEntitiesPage final : public ::google::protobuf::Message return reinterpret_cast( &_NSPanelRoomEntitiesPage_default_instance_); } - static constexpr int kIndexInFileMessages = 5; + static constexpr int kIndexInFileMessages = 6; friend void swap(NSPanelRoomEntitiesPage& a, NSPanelRoomEntitiesPage& b) { a.Swap(&b); } inline void Swap(NSPanelRoomEntitiesPage* other) { if (other == this) return; @@ -4594,7 +4820,7 @@ class NSPanelMQTTManagerCommand final : public ::google::protobuf::Message return reinterpret_cast( &_NSPanelMQTTManagerCommand_default_instance_); } - static constexpr int kIndexInFileMessages = 18; + static constexpr int kIndexInFileMessages = 19; friend void swap(NSPanelMQTTManagerCommand& a, NSPanelMQTTManagerCommand& b) { a.Swap(&b); } inline void Swap(NSPanelMQTTManagerCommand* other) { if (other == this) return; @@ -5001,7 +5227,7 @@ class NSPanelConfig final : public ::google::protobuf::Message return reinterpret_cast( &_NSPanelConfig_default_instance_); } - static constexpr int kIndexInFileMessages = 1; + static constexpr int kIndexInFileMessages = 2; friend void swap(NSPanelConfig& a, NSPanelConfig& b) { a.Swap(&b); } inline void Swap(NSPanelConfig* other) { if (other == this) return; @@ -5068,6 +5294,7 @@ class NSPanelConfig final : public ::google::protobuf::Message ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- using RoomInfo = NSPanelConfig_RoomInfo; + using Sound = NSPanelConfig_Sound; using NSPanelDefaultPage = NSPanelConfig_NSPanelDefaultPage; static constexpr NSPanelDefaultPage HOME = NSPanelConfig_NSPanelDefaultPage_HOME; static constexpr NSPanelDefaultPage SCENES = NSPanelConfig_NSPanelDefaultPage_SCENES; @@ -5132,6 +5359,26 @@ class NSPanelConfig final : public ::google::protobuf::Message static inline bool NSPanelButtonMode_Parse(absl::string_view name, NSPanelButtonMode* value) { return NSPanelConfig_NSPanelButtonMode_Parse(name, value); } + using NSPanelSoundEvent = NSPanelConfig_NSPanelSoundEvent; + static constexpr NSPanelSoundEvent TOUCH = NSPanelConfig_NSPanelSoundEvent_TOUCH; + static constexpr NSPanelSoundEvent SCENE_ACTIVATED = NSPanelConfig_NSPanelSoundEvent_SCENE_ACTIVATED; + static constexpr NSPanelSoundEvent SCENE_SAVED = NSPanelConfig_NSPanelSoundEvent_SCENE_SAVED; + static inline bool NSPanelSoundEvent_IsValid(int value) { + return NSPanelConfig_NSPanelSoundEvent_IsValid(value); + } + static constexpr NSPanelSoundEvent NSPanelSoundEvent_MIN = NSPanelConfig_NSPanelSoundEvent_NSPanelSoundEvent_MIN; + static constexpr NSPanelSoundEvent NSPanelSoundEvent_MAX = NSPanelConfig_NSPanelSoundEvent_NSPanelSoundEvent_MAX; + static constexpr int NSPanelSoundEvent_ARRAYSIZE = NSPanelConfig_NSPanelSoundEvent_NSPanelSoundEvent_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* NSPanelSoundEvent_descriptor() { + return NSPanelConfig_NSPanelSoundEvent_descriptor(); + } + template + static inline const std::string& NSPanelSoundEvent_Name(T value) { + return NSPanelConfig_NSPanelSoundEvent_Name(value); + } + static inline bool NSPanelSoundEvent_Parse(absl::string_view name, NSPanelSoundEvent* value) { + return NSPanelConfig_NSPanelSoundEvent_Parse(name, value); + } // accessors ------------------------------------------------------- enum : int { @@ -5139,6 +5386,7 @@ class NSPanelConfig final : public ::google::protobuf::Message kGlobalSceneEntityPageIdsFieldNumber = 30, kRelay1RelayGroupFieldNumber = 35, kRelay2RelayGroupFieldNumber = 37, + kSoundsFieldNumber = 45, kNameFieldNumber = 1, kInsideTemperatureSensorMqttTopicFieldNumber = 40, kDefaultRoomFieldNumber = 2, @@ -5243,6 +5491,23 @@ class NSPanelConfig final : public ::google::protobuf::Message ::google::protobuf::RepeatedField<::int32_t>* _internal_mutable_relay2_relay_group(); public: + // repeated .NSPanelConfig.Sound sounds = 45; + int sounds_size() const; + private: + int _internal_sounds_size() const; + + public: + void clear_sounds() ; + ::NSPanelConfig_Sound* mutable_sounds(int index); + ::google::protobuf::RepeatedPtrField<::NSPanelConfig_Sound>* mutable_sounds(); + + private: + const ::google::protobuf::RepeatedPtrField<::NSPanelConfig_Sound>& _internal_sounds() const; + ::google::protobuf::RepeatedPtrField<::NSPanelConfig_Sound>* _internal_mutable_sounds(); + public: + const ::NSPanelConfig_Sound& sounds(int index) const; + ::NSPanelConfig_Sound* add_sounds(); + const ::google::protobuf::RepeatedPtrField<::NSPanelConfig_Sound>& sounds() const; // string name = 1; void clear_name() ; const std::string& name() const; @@ -5580,7 +5845,7 @@ class NSPanelConfig final : public ::google::protobuf::Message class _Internal; friend class ::google::protobuf::internal::TcParser; static const ::google::protobuf::internal::TcParseTable< - 5, 36, 1, + 5, 37, 2, 94, 7> _table_; @@ -5608,6 +5873,7 @@ class NSPanelConfig final : public ::google::protobuf::Message mutable ::google::protobuf::internal::CachedSize _relay1_relay_group_cached_byte_size_; ::google::protobuf::RepeatedField<::int32_t> relay2_relay_group_; mutable ::google::protobuf::internal::CachedSize _relay2_relay_group_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::NSPanelConfig_Sound > sounds_; ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::internal::ArenaStringPtr inside_temperature_sensor_mqtt_topic_; ::int32_t default_room_; @@ -5777,6 +6043,82 @@ inline ::google::protobuf::RepeatedField<::int32_t>* NSPanelConfig_RoomInfo::_in // ------------------------------------------------------------------- +// NSPanelConfig_Sound + +// .NSPanelConfig.NSPanelSoundEvent event = 1; +inline void NSPanelConfig_Sound::clear_event() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.event_ = 0; +} +inline ::NSPanelConfig_NSPanelSoundEvent NSPanelConfig_Sound::event() const { + // @@protoc_insertion_point(field_get:NSPanelConfig.Sound.event) + return _internal_event(); +} +inline void NSPanelConfig_Sound::set_event(::NSPanelConfig_NSPanelSoundEvent value) { + _internal_set_event(value); + // @@protoc_insertion_point(field_set:NSPanelConfig.Sound.event) +} +inline ::NSPanelConfig_NSPanelSoundEvent NSPanelConfig_Sound::_internal_event() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::NSPanelConfig_NSPanelSoundEvent>(_impl_.event_); +} +inline void NSPanelConfig_Sound::_internal_set_event(::NSPanelConfig_NSPanelSoundEvent value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.event_ = value; +} + +// string rtttl = 2; +inline void NSPanelConfig_Sound::clear_rtttl() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.rtttl_.ClearToEmpty(); +} +inline const std::string& NSPanelConfig_Sound::rtttl() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:NSPanelConfig.Sound.rtttl) + return _internal_rtttl(); +} +template +inline PROTOBUF_ALWAYS_INLINE void NSPanelConfig_Sound::set_rtttl(Arg_&& arg, + Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.rtttl_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:NSPanelConfig.Sound.rtttl) +} +inline std::string* NSPanelConfig_Sound::mutable_rtttl() ABSL_ATTRIBUTE_LIFETIME_BOUND { + std::string* _s = _internal_mutable_rtttl(); + // @@protoc_insertion_point(field_mutable:NSPanelConfig.Sound.rtttl) + return _s; +} +inline const std::string& NSPanelConfig_Sound::_internal_rtttl() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.rtttl_.Get(); +} +inline void NSPanelConfig_Sound::_internal_set_rtttl(const std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.rtttl_.Set(value, GetArena()); +} +inline std::string* NSPanelConfig_Sound::_internal_mutable_rtttl() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.rtttl_.Mutable( GetArena()); +} +inline std::string* NSPanelConfig_Sound::release_rtttl() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:NSPanelConfig.Sound.rtttl) + return _impl_.rtttl_.Release(); +} +inline void NSPanelConfig_Sound::set_allocated_rtttl(std::string* value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.rtttl_.SetAllocated(value, GetArena()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.rtttl_.IsDefault()) { + _impl_.rtttl_.Set("", GetArena()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:NSPanelConfig.Sound.rtttl) +} + +// ------------------------------------------------------------------- + // NSPanelConfig // string name = 1; @@ -6723,6 +7065,55 @@ inline void NSPanelConfig::_internal_set_button2_upper_temperature(::int32_t val _impl_.button2_upper_temperature_ = value; } +// repeated .NSPanelConfig.Sound sounds = 45; +inline int NSPanelConfig::_internal_sounds_size() const { + return _internal_sounds().size(); +} +inline int NSPanelConfig::sounds_size() const { + return _internal_sounds_size(); +} +inline void NSPanelConfig::clear_sounds() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.sounds_.Clear(); +} +inline ::NSPanelConfig_Sound* NSPanelConfig::mutable_sounds(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:NSPanelConfig.sounds) + return _internal_mutable_sounds()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField<::NSPanelConfig_Sound>* NSPanelConfig::mutable_sounds() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable_list:NSPanelConfig.sounds) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_sounds(); +} +inline const ::NSPanelConfig_Sound& NSPanelConfig::sounds(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:NSPanelConfig.sounds) + return _internal_sounds().Get(index); +} +inline ::NSPanelConfig_Sound* NSPanelConfig::add_sounds() ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::NSPanelConfig_Sound* _add = _internal_mutable_sounds()->Add(); + // @@protoc_insertion_point(field_add:NSPanelConfig.sounds) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField<::NSPanelConfig_Sound>& NSPanelConfig::sounds() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:NSPanelConfig.sounds) + return _internal_sounds(); +} +inline const ::google::protobuf::RepeatedPtrField<::NSPanelConfig_Sound>& +NSPanelConfig::_internal_sounds() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.sounds_; +} +inline ::google::protobuf::RepeatedPtrField<::NSPanelConfig_Sound>* +NSPanelConfig::_internal_mutable_sounds() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.sounds_; +} + // ------------------------------------------------------------------- // NSPanelWarning @@ -10413,6 +10804,12 @@ inline const EnumDescriptor* GetEnumDescriptor<::NSPanelConfig_NSPanelButtonMode return ::NSPanelConfig_NSPanelButtonMode_descriptor(); } template <> +struct is_proto_enum<::NSPanelConfig_NSPanelSoundEvent> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::NSPanelConfig_NSPanelSoundEvent>() { + return ::NSPanelConfig_NSPanelSoundEvent_descriptor(); +} +template <> struct is_proto_enum<::NSPanelStatusReport_state> : std::true_type {}; template <> inline const EnumDescriptor* GetEnumDescriptor<::NSPanelStatusReport_state>() { diff --git a/docker/protobuf/protobuf_nspanel.proto b/docker/protobuf/protobuf_nspanel.proto index 78fc5a4a..e5ca8579 100644 --- a/docker/protobuf/protobuf_nspanel.proto +++ b/docker/protobuf/protobuf_nspanel.proto @@ -76,6 +76,19 @@ message NSPanelConfig { int32 button1_upper_temperature = 42; // At what temperature should relay1 turn off (heating) or on (cooling) when in thermostat mode. int32 button2_lower_temperature = 43; // At what temperature should relay2 turn on (heating) or off (cooling) when in thermostat mode. int32 button2_upper_temperature = 44; // At what temperature should relay2 turn off (heating) or on (cooling) when in thermostat mode. + + // Sounds played by the panel buzzer, one entry per event. An event without an entry, or with an empty rtttl, is silent. + // Panels ignore events they do not know about. + enum NSPanelSoundEvent { + TOUCH = 0; // The screen was touched + SCENE_ACTIVATED = 1; // A scene was triggered from the panel. Played instead of the TOUCH sound for that touch. + SCENE_SAVED = 2; // A scene was saved from the panel + } + message Sound { + NSPanelSoundEvent event = 1; + string rtttl = 2; // Melody in RTTTL format, ex. "touch:d=32,o=6,b=190:g6,16p,32c7" + } + repeated Sound sounds = 45; } enum NSPanelWarningLevel { From a55a1be7961c32c779a7cfefdb21c2db1f27a66c Mon Sep 17 00:00:00 2001 From: James Mulcahy Date: Tue, 13 Oct 2026 12:21:50 -0700 Subject: [PATCH 2/2] Test the buzzer sounds sent in NSPanelConfig Covers a panel with no buzzer settings, the global sound for each event, and panel settings overriding the global ones, including an empty panel setting silencing an event that has a global sound. Co-Authored-By: Claude Opus 5.5 --- docker/MQTTManager/tests/nspanel_test.cpp | 53 +++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/docker/MQTTManager/tests/nspanel_test.cpp b/docker/MQTTManager/tests/nspanel_test.cpp index 60491f10..a501772f 100644 --- a/docker/MQTTManager/tests/nspanel_test.cpp +++ b/docker/MQTTManager/tests/nspanel_test.cpp @@ -409,6 +409,59 @@ TEST_F(NSPanelTest, panel_locked_to_its_room_only_gets_that_room) { EXPECT_EQ(std::vector(config->room_infos(0).entity_page_ids().begin(), config->room_infos(0).entity_page_ids().end()), std::vector({panel_rooms().entities_page_id})); } +TEST_F(NSPanelTest, config_has_no_sounds_without_buzzer_settings) { + load_panel(); + + auto config = last_published_config(); + ASSERT_TRUE(config.has_value()); + EXPECT_EQ(config->sounds_size(), 0); +} + +TEST_F(NSPanelTest, global_buzzer_sounds_are_sent_per_event) { + OnExit reset{[] { + MqttManagerConfig::set_setting_value(MQTT_MANAGER_SETTING::BUZZER_SOUND_TOUCH, ""); + MqttManagerConfig::set_setting_value(MQTT_MANAGER_SETTING::BUZZER_SOUND_SCENE_ACTIVATED, ""); + MqttManagerConfig::set_setting_value(MQTT_MANAGER_SETTING::BUZZER_SOUND_SCENE_SAVED, ""); + }}; + MqttManagerConfig::set_setting_value(MQTT_MANAGER_SETTING::BUZZER_SOUND_TOUCH, "touch:d=32,o=6,b=190:g6"); + MqttManagerConfig::set_setting_value(MQTT_MANAGER_SETTING::BUZZER_SOUND_SCENE_ACTIVATED, "activated:d=16,o=6,b=180:c,e,g"); + MqttManagerConfig::set_setting_value(MQTT_MANAGER_SETTING::BUZZER_SOUND_SCENE_SAVED, "saved:d=8,o=5,b=120:c6"); + + load_panel(); + + auto config = last_published_config(); + ASSERT_TRUE(config.has_value()); + ASSERT_EQ(config->sounds_size(), 3); + EXPECT_EQ(config->sounds(0).event(), NSPanelConfig_NSPanelSoundEvent_TOUCH); + EXPECT_EQ(config->sounds(0).rtttl(), "touch:d=32,o=6,b=190:g6"); + EXPECT_EQ(config->sounds(1).event(), NSPanelConfig_NSPanelSoundEvent_SCENE_ACTIVATED); + EXPECT_EQ(config->sounds(1).rtttl(), "activated:d=16,o=6,b=180:c,e,g"); + EXPECT_EQ(config->sounds(2).event(), NSPanelConfig_NSPanelSoundEvent_SCENE_SAVED); + EXPECT_EQ(config->sounds(2).rtttl(), "saved:d=8,o=5,b=120:c6"); +} + +TEST_F(NSPanelTest, panel_buzzer_settings_override_the_global_sounds) { + OnExit reset{[] { + MqttManagerConfig::set_setting_value(MQTT_MANAGER_SETTING::BUZZER_SOUND_TOUCH, ""); + MqttManagerConfig::set_setting_value(MQTT_MANAGER_SETTING::BUZZER_SOUND_SCENE_ACTIVATED, ""); + }}; + MqttManagerConfig::set_setting_value(MQTT_MANAGER_SETTING::BUZZER_SOUND_TOUCH, "global_touch:d=32,o=6,b=190:g6"); + MqttManagerConfig::set_setting_value(MQTT_MANAGER_SETTING::BUZZER_SOUND_SCENE_ACTIVATED, "global_activated:d=16,o=6,b=180:c"); + set_panel_setting("buzzer_sound_touch", "panel_touch:d=32,o=7,b=200:c"); + set_panel_setting("buzzer_sound_scene_activated", ""); // Silences the event on this panel only. + set_panel_setting("buzzer_sound_scene_saved", "panel_saved:d=8,o=5,b=120:e"); + + load_panel(); + + auto config = last_published_config(); + ASSERT_TRUE(config.has_value()); + ASSERT_EQ(config->sounds_size(), 2); + EXPECT_EQ(config->sounds(0).event(), NSPanelConfig_NSPanelSoundEvent_TOUCH); + EXPECT_EQ(config->sounds(0).rtttl(), "panel_touch:d=32,o=7,b=200:c"); + EXPECT_EQ(config->sounds(1).event(), NSPanelConfig_NSPanelSoundEvent_SCENE_SAVED); + EXPECT_EQ(config->sounds(1).rtttl(), "panel_saved:d=8,o=5,b=120:e"); +} + TEST_F(NSPanelTest, reload_config_sends_changed_settings) { load_panel(); last_published_config();