diff --git a/docker/MQTTManager/include/database_manager/database_manager.hpp b/docker/MQTTManager/include/database_manager/database_manager.hpp index 6fb9cb0b..8a105884 100644 --- a/docker/MQTTManager/include/database_manager/database_manager.hpp +++ b/docker/MQTTManager/include/database_manager/database_manager.hpp @@ -32,8 +32,16 @@ struct NSPanel { std::string version; std::optional button1_detached_mode_entity_id = 0; int button1_mode = 0; + int button1_fallback_mode = 0; std::optional button2_detached_mode_entity_id = 0; int button2_mode = 0; + int button2_fallback_mode = 0; + std::optional button1_long_detached_mode_entity_id = 0; + int button1_long_mode = 0; + int button1_long_fallback_mode = 0; + std::optional button2_long_detached_mode_entity_id = 0; + int button2_long_mode = 0; + int button2_long_fallback_mode = 0; std::string md5_data_file; std::string md5_firmware; std::string md5_tft_file; @@ -130,8 +138,16 @@ static inline auto database = sqlite_orm::make_storage("/data/nspanelmanager_db. sqlite_orm::make_column("version", &NSPanel::version), sqlite_orm::make_column("button1_detached_mode_entity_id", &NSPanel::button1_detached_mode_entity_id), sqlite_orm::make_column("button1_mode", &NSPanel::button1_mode), + sqlite_orm::make_column("button1_mode", &NSPanel::button1_fallback_mode), sqlite_orm::make_column("button2_detached_mode_entity_id", &NSPanel::button2_detached_mode_entity_id), sqlite_orm::make_column("button2_mode", &NSPanel::button2_mode), + sqlite_orm::make_column("button2_mode", &NSPanel::button2_fallback_mode), + sqlite_orm::make_column("button1_long_detached_mode_entity_id", &NSPanel::button1_long_detached_mode_entity_id), + sqlite_orm::make_column("button1_long_mode", &NSPanel::button1_long_mode), + sqlite_orm::make_column("button1_long_mode", &NSPanel::button1_long_fallback_mode), + sqlite_orm::make_column("button2_long_detached_mode_entity_id", &NSPanel::button2_long_detached_mode_entity_id), + sqlite_orm::make_column("button2_long_mode", &NSPanel::button2_long_mode), + sqlite_orm::make_column("button2_long_mode", &NSPanel::button2_long_fallback_mode), sqlite_orm::make_column("md5_data_file", &NSPanel::md5_data_file), sqlite_orm::make_column("md5_firmware", &NSPanel::md5_firmware), sqlite_orm::make_column("md5_tft_file", &NSPanel::md5_tft_file), diff --git a/docker/MQTTManager/include/entity_manager/entity_manager.hpp b/docker/MQTTManager/include/entity_manager/entity_manager.hpp index bf80f7b5..af6a4ef5 100644 --- a/docker/MQTTManager/include/entity_manager/entity_manager.hpp +++ b/docker/MQTTManager/include/entity_manager/entity_manager.hpp @@ -137,7 +137,7 @@ class EntityManager { std::lock_guard mutex_guard(EntityManager::_entities_mutex); auto rit = EntityManager::_entities.cbegin(); while (rit != EntityManager::_entities.cend()) { - if ((type != MQTT_MANAGER_ENTITY_TYPE::ANY && (*rit)->get_type() == type) && (*rit)->get_id() == id) { + if ((type == MQTT_MANAGER_ENTITY_TYPE::ANY || (*rit)->get_type() == type) && (*rit)->get_id() == id) { return std::static_pointer_cast(*rit); } else { ++rit; diff --git a/docker/MQTTManager/include/mqtt_manager_config/mqtt_manager_config.cpp b/docker/MQTTManager/include/mqtt_manager_config/mqtt_manager_config.cpp index 4139693b..c01b5b32 100644 --- a/docker/MQTTManager/include/mqtt_manager_config/mqtt_manager_config.cpp +++ b/docker/MQTTManager/include/mqtt_manager_config/mqtt_manager_config.cpp @@ -166,7 +166,7 @@ void MqttManagerConfig::update_firmware_checksum() { std::lock_guard lock_guard(MqttManagerConfig::_md5_checksum_files_mutex); SPDLOG_INFO("Updating/calculating MD5 checksums for all firmware files."); - auto firmware_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/firmware.bin"); + auto firmware_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/firmware.bin")); if (firmware_checksum.has_value()) { MqttManagerConfig::_md5_checksum_firmware = firmware_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for firmware was not able to be calculated."); @@ -176,7 +176,7 @@ void MqttManagerConfig::update_firmware_checksum() { SPDLOG_ERROR("Failed to calculate checksum for firmware!"); } - auto littlefs_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/data_file.bin"); + auto littlefs_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/data_file.bin")); if (littlefs_checksum.has_value()) { MqttManagerConfig::_md5_checksum_littlefs = littlefs_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for littlefs/data file was not able to be calculated."); @@ -191,7 +191,7 @@ void MqttManagerConfig::update_tft_checksums() { std::lock_guard lock_guard(MqttManagerConfig::_md5_checksum_files_mutex); SPDLOG_INFO("Updating/calculating MD5 checksums for all .tft GUI files."); - auto eu_tft1_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/HMI_files/tft_automation/eu/output_tft1/gui.tft"); + auto eu_tft1_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/HMI_files/tft_automation/eu/output_tft1/gui.tft")); if (eu_tft1_checksum.has_value()) { MqttManagerConfig::_md5_checksum_eu_tft1 = eu_tft1_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for EU tft1 was not able to be calculated."); @@ -201,7 +201,7 @@ void MqttManagerConfig::update_tft_checksums() { SPDLOG_ERROR("Failed to calculate checksum for EU TFT1 Nextion GUI file!"); } - auto eu_tft2_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/HMI_files/tft_automation/eu/output_tft2/gui.tft"); + auto eu_tft2_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/HMI_files/tft_automation/eu/output_tft2/gui.tft")); if (eu_tft2_checksum.has_value()) { MqttManagerConfig::_md5_checksum_eu_tft2 = eu_tft2_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for EU tft2 was not able to be calculated."); @@ -211,7 +211,7 @@ void MqttManagerConfig::update_tft_checksums() { SPDLOG_ERROR("Failed to calculate checksum for EU TFT2 Nextion GUI file!"); } - auto eu_tft3_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/HMI_files/tft_automation/eu/output_tft3/gui.tft"); + auto eu_tft3_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/HMI_files/tft_automation/eu/output_tft3/gui.tft")); if (eu_tft3_checksum.has_value()) { MqttManagerConfig::_md5_checksum_eu_tft3 = eu_tft3_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for EU tft3 was not able to be calculated."); @@ -221,7 +221,7 @@ void MqttManagerConfig::update_tft_checksums() { SPDLOG_ERROR("Failed to calculate checksum for EU TFT3 Nextion GUI file!"); } - auto eu_tft4_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/HMI_files/tft_automation/eu/output_tft4/gui.tft"); + auto eu_tft4_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/HMI_files/tft_automation/eu/output_tft4/gui.tft")); if (eu_tft4_checksum.has_value()) { MqttManagerConfig::_md5_checksum_eu_tft4 = eu_tft4_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for EU tft4 was not able to be calculated."); @@ -231,7 +231,7 @@ void MqttManagerConfig::update_tft_checksums() { SPDLOG_ERROR("Failed to calculate checksum for EU TFT4 Nextion GUI file!"); } - auto us_tft1_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/HMI_files/tft_automation/us/output_tft1/gui.tft"); + auto us_tft1_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/HMI_files/tft_automation/us/output_tft1/gui.tft")); if (us_tft1_checksum.has_value()) { MqttManagerConfig::_md5_checksum_us_tft1 = us_tft1_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for US tft1 was not able to be calculated."); @@ -241,7 +241,7 @@ void MqttManagerConfig::update_tft_checksums() { SPDLOG_ERROR("Failed to calculate checksum for US TFT1 Nextion GUI file!"); } - auto us_tft2_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/HMI_files/tft_automation/us/output_tft2/gui.tft"); + auto us_tft2_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/HMI_files/tft_automation/us/output_tft2/gui.tft")); if (us_tft2_checksum.has_value()) { MqttManagerConfig::_md5_checksum_us_tft2 = us_tft2_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for US tft2 was not able to be calculated."); @@ -251,7 +251,7 @@ void MqttManagerConfig::update_tft_checksums() { SPDLOG_ERROR("Failed to calculate checksum for US TFT2 Nextion GUI file!"); } - auto us_tft3_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/HMI_files/tft_automation/us/output_tft3/gui.tft"); + auto us_tft3_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/HMI_files/tft_automation/us/output_tft3/gui.tft")); if (us_tft3_checksum.has_value()) { MqttManagerConfig::_md5_checksum_us_tft3 = us_tft3_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for US tft3 was not able to be calculated."); @@ -261,7 +261,7 @@ void MqttManagerConfig::update_tft_checksums() { SPDLOG_ERROR("Failed to calculate checksum for US TFT3 Nextion GUI file!"); } - auto us_tft4_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/HMI_files/tft_automation/us/output_tft4/gui.tft"); + auto us_tft4_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/HMI_files/tft_automation/us/output_tft4/gui.tft")); if (us_tft4_checksum.has_value()) { MqttManagerConfig::_md5_checksum_us_tft4 = us_tft4_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for US tft4 was not able to be calculated."); @@ -271,7 +271,7 @@ void MqttManagerConfig::update_tft_checksums() { SPDLOG_ERROR("Failed to calculate checksum for US TFT4 Nextion GUI file!"); } - auto us_tft1_horizontal_mirrored_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/HMI_files/tft_automation/us_horizontal_mirrored/output_tft1/gui.tft"); + auto us_tft1_horizontal_mirrored_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/HMI_files/tft_automation/us_horizontal_mirrored/output_tft1/gui.tft")); if (us_tft1_horizontal_mirrored_checksum.has_value()) { MqttManagerConfig::_md5_checksum_us_horizontal_mirrored_tft1 = us_tft1_horizontal_mirrored_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for US tft1 (mirrored) was not able to be calculated."); @@ -281,7 +281,7 @@ void MqttManagerConfig::update_tft_checksums() { SPDLOG_ERROR("Failed to calculate checksum for US landscape mirrored TFT1 Nextion GUI file!"); } - auto us_tft2_horizontal_mirrored_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/HMI_files/tft_automation/us_horizontal_mirrored/output_tft2/gui.tft"); + auto us_tft2_horizontal_mirrored_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/HMI_files/tft_automation/us_horizontal_mirrored/output_tft2/gui.tft")); if (us_tft2_horizontal_mirrored_checksum.has_value()) { MqttManagerConfig::_md5_checksum_us_horizontal_mirrored_tft2 = us_tft2_horizontal_mirrored_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for US tft2 (mirrored) was not able to be calculated."); @@ -291,7 +291,7 @@ void MqttManagerConfig::update_tft_checksums() { SPDLOG_ERROR("Failed to calculate checksum for US landscape mirrored TFT2 Nextion GUI file!"); } - auto us_tft3_horizontal_mirrored_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/HMI_files/tft_automation/us_horizontal_mirrored/output_tft3/gui.tft"); + auto us_tft3_horizontal_mirrored_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/HMI_files/tft_automation/us_horizontal_mirrored/output_tft3/gui.tft")); if (us_tft3_horizontal_mirrored_checksum.has_value()) { MqttManagerConfig::_md5_checksum_us_horizontal_mirrored_tft3 = us_tft3_horizontal_mirrored_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for US tft3 (mirrored) was not able to be calculated."); @@ -301,7 +301,7 @@ void MqttManagerConfig::update_tft_checksums() { SPDLOG_ERROR("Failed to calculate checksum for US landscape mirrored TFT3 Nextion GUI file!"); } - auto us_tft4_horizontal_mirrored_checksum = MqttManagerConfig::_get_file_md5_checksum("/usr/src/app/nspanelmanager/HMI_files/tft_automation/us_horizontal_mirrored/output_tft4/gui.tft"); + auto us_tft4_horizontal_mirrored_checksum = MqttManagerConfig::_get_file_md5_checksum(PREPEND_HMI_LOCATION("/HMI_files/tft_automation/us_horizontal_mirrored/output_tft4/gui.tft")); if (us_tft4_horizontal_mirrored_checksum.has_value()) { MqttManagerConfig::_md5_checksum_us_horizontal_mirrored_tft4 = us_tft4_horizontal_mirrored_checksum.value(); WebsocketServer::remove_warning("MD5 checksum for US tft4 (mirrored) was not able to be calculated."); 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 22819b45..5a42faee 100644 --- a/docker/MQTTManager/include/mqtt_manager_config/mqtt_manager_config.hpp +++ b/docker/MQTTManager/include/mqtt_manager_config/mqtt_manager_config.hpp @@ -18,6 +18,8 @@ #include #endif +#define PREPEND_HMI_LOCATION(file) "/usr/src/app/nspanelmanager" file + enum LightTurnOnBehaviour { COLOR_TEMPERATURE, RESTORE_PREVIOUS, diff --git a/docker/MQTTManager/include/nspanel/nspanel.cpp b/docker/MQTTManager/include/nspanel/nspanel.cpp index 54aefc23..e9891c98 100644 --- a/docker/MQTTManager/include/nspanel/nspanel.cpp +++ b/docker/MQTTManager/include/nspanel/nspanel.cpp @@ -72,8 +72,16 @@ std::shared_ptr NSPanel::create_from_discovery_request(nlohmann::json r panel_data.version = request_data.at("version").get(); panel_data.button1_detached_mode_entity_id = std::nullopt; panel_data.button1_mode = 0; + panel_data.button1_fallback_mode = 0; panel_data.button2_detached_mode_entity_id = std::nullopt; panel_data.button2_mode = 0; + panel_data.button2_fallback_mode = 0; + panel_data.button1_long_detached_mode_entity_id = std::nullopt; + panel_data.button1_long_mode = 0; + panel_data.button1_long_fallback_mode = 0; + panel_data.button2_long_detached_mode_entity_id = std::nullopt; + panel_data.button2_long_mode = 0; + panel_data.button2_long_fallback_mode = 0; panel_data.md5_data_file = request_data.at("md5_data_file").get(); panel_data.md5_firmware = request_data.at("md5_firmware").get(); panel_data.md5_tft_file = request_data.at("md5_tft_file").get(); @@ -276,36 +284,67 @@ void NSPanel::send_config() { config.set_button1_upper_temperature(std::stoi(this->_get_nspanel_setting_with_default("button1_relay_upper_temperature", "0"))); config.set_button2_lower_temperature(std::stoi(this->_get_nspanel_setting_with_default("button2_relay_lower_temperature", "0"))); config.set_button2_upper_temperature(std::stoi(this->_get_nspanel_setting_with_default("button2_relay_upper_temperature", "0"))); + config.set_button1_fallback_mode(static_cast(std::stoi(this->_get_nspanel_setting_with_default("button1_fallback_mode", "0")))); + config.set_button2_fallback_mode(static_cast(std::stoi(this->_get_nspanel_setting_with_default("button2_fallback_mode", "0")))); + config.set_button1_long_fallback_mode(static_cast(std::stoi(this->_get_nspanel_setting_with_default("button1_long_fallback_mode", "0")))); + config.set_button2_long_fallback_mode(static_cast(std::stoi(this->_get_nspanel_setting_with_default("button2_long_fallback_mode", "0")))); + if ((*default_room)->has_temperature_sensor()) { config.set_inside_temperature_sensor_mqtt_topic((*default_room)->get_temperature_sensor_mqtt_topic()); } - ButtonMode b1_mode = static_cast(this->_settings.button1_mode); - if (b1_mode == ButtonMode::DIRECT) { + NSPanelConfig::NSPanelButtonMode b1_mode = static_cast< NSPanelConfig::NSPanelButtonMode>(this->_settings.button1_mode); + if (b1_mode == NSPanelConfig::DIRECT) { config.set_button1_mode(NSPanelConfig_NSPanelButtonMode_DIRECT); - } else if (b1_mode == ButtonMode::FOLLOW) { + } else if (b1_mode == NSPanelConfig::FOLLOW) { config.set_button1_mode(NSPanelConfig_NSPanelButtonMode_FOLLOW); - } else if (b1_mode == ButtonMode::THERMOSTAT_HEATING) { + } else if (b1_mode == NSPanelConfig::THERMOSTAT_HEAT) { config.set_button1_mode(NSPanelConfig_NSPanelButtonMode_THERMOSTAT_HEAT); - } else if (b1_mode == ButtonMode::THERMOSTAT_COOLING) { + } else if (b1_mode == NSPanelConfig::THERMOSTAT_COOL) { config.set_button1_mode(NSPanelConfig_NSPanelButtonMode_THERMOSTAT_COOL); } else { config.set_button1_mode(NSPanelConfig_NSPanelButtonMode_NOTIFY_MANAGER); } - ButtonMode b2_mode = static_cast(this->_settings.button2_mode); - if (b2_mode == ButtonMode::DIRECT) { + NSPanelConfig::NSPanelButtonMode b2_mode = static_cast< NSPanelConfig::NSPanelButtonMode>(this->_settings.button2_mode); + if (b2_mode == NSPanelConfig::DIRECT) { config.set_button2_mode(NSPanelConfig_NSPanelButtonMode_DIRECT); - } else if (b2_mode == ButtonMode::FOLLOW) { + } else if (b2_mode == NSPanelConfig::FOLLOW) { config.set_button2_mode(NSPanelConfig_NSPanelButtonMode_FOLLOW); - } else if (b2_mode == ButtonMode::THERMOSTAT_HEATING) { + } else if (b2_mode == NSPanelConfig::THERMOSTAT_HEAT) { config.set_button2_mode(NSPanelConfig_NSPanelButtonMode_THERMOSTAT_HEAT); - } else if (b2_mode == ButtonMode::THERMOSTAT_COOLING) { + } else if (b2_mode == NSPanelConfig::THERMOSTAT_COOL) { config.set_button2_mode(NSPanelConfig_NSPanelButtonMode_THERMOSTAT_COOL); } else { config.set_button2_mode(NSPanelConfig_NSPanelButtonMode_NOTIFY_MANAGER); } + NSPanelConfig::NSPanelButtonMode b1_long_mode = static_cast< NSPanelConfig::NSPanelButtonMode>(this->_settings.button1_long_mode); + if (b1_long_mode == NSPanelConfig::DIRECT) { + config.set_button1_long_mode(NSPanelConfig_NSPanelButtonMode_DIRECT); + } else if (b1_long_mode == NSPanelConfig::FOLLOW) { + config.set_button1_long_mode(NSPanelConfig_NSPanelButtonMode_FOLLOW); + } else if (b1_long_mode == NSPanelConfig::THERMOSTAT_HEAT) { + config.set_button1_long_mode(NSPanelConfig_NSPanelButtonMode_THERMOSTAT_HEAT); + } else if (b1_long_mode == NSPanelConfig::THERMOSTAT_COOL) { + config.set_button1_long_mode(NSPanelConfig_NSPanelButtonMode_THERMOSTAT_COOL); + } else { + config.set_button1_long_mode(NSPanelConfig_NSPanelButtonMode_NOTIFY_MANAGER); + } + + NSPanelConfig::NSPanelButtonMode b2_long_mode = static_cast< NSPanelConfig::NSPanelButtonMode>(this->_settings.button2_long_mode); + if (b2_long_mode == NSPanelConfig::DIRECT) { + config.set_button2_long_mode(NSPanelConfig_NSPanelButtonMode_DIRECT); + } else if (b2_long_mode == NSPanelConfig::FOLLOW) { + config.set_button2_long_mode(NSPanelConfig_NSPanelButtonMode_FOLLOW); + } else if (b2_long_mode == NSPanelConfig::THERMOSTAT_HEAT) { + config.set_button2_long_mode(NSPanelConfig_NSPanelButtonMode_THERMOSTAT_HEAT); + } else if (b2_long_mode == NSPanelConfig::THERMOSTAT_COOL) { + config.set_button2_long_mode(NSPanelConfig_NSPanelButtonMode_THERMOSTAT_COOL); + } else { + config.set_button2_long_mode(NSPanelConfig_NSPanelButtonMode_NOTIFY_MANAGER); + } + config.set_optimistic_mode(MqttManagerConfig::get_setting_with_default(MQTT_MANAGER_SETTING::OPTIMISTIC_MODE)); config.set_raise_light_level_to_100_above(MqttManagerConfig::get_setting_with_default(MQTT_MANAGER_SETTING::RAISE_TO_100_LIGHT_LEVEL)); @@ -579,6 +618,7 @@ void NSPanel::mqtt_callback(std::string topic, std::string payload) { this->_rssi = report.rssi(); this->_heap_used_pct = report.heap_used_pct(); this->_temperature = report.temperature(); + this->_version = report.version(); this->_current_firmware_md5_checksum = report.md5_firmware(); this->_current_littlefs_md5_checksum = report.md5_littlefs(); this->_current_tft_md5_checksum = report.md5_tft_gui(); @@ -796,6 +836,8 @@ void NSPanel::send_websocket_status_update() { nlohmann::json status_data = { {"id", this->_id}, {"name", this->_name}, + {"version", this->_version}, + {"firmware_md5", this->_current_firmware_md5_checksum}, {"ip_address", this->_ip_address}, {"rssi", this->_rssi}, {"temperature", this->_temperature}, @@ -1040,6 +1082,7 @@ nlohmann::json NSPanel::get_websocket_json_representation() { data["nspanel_id"] = this->_id; } data["name"] = this->_name; + data["version"] = this->_version; data["rssi"] = this->_rssi; data["heap_used_pct"] = this->_heap_used_pct; data["mac_address"] = send_mac; @@ -1171,6 +1214,7 @@ void NSPanel::register_to_home_assistant() { base_json["device"]["manufacturer"] = "Sonoff"; base_json["device"]["model"] = "NSPanel"; base_json["device"]["name"] = this->_name; + base_json["device"]["version"] = this->_version; base_json["availability"] = nlohmann::json(); base_json["availability"]["topic"] = this->_mqtt_status_topic; base_json["availability"]["value_template"] = "{{ value_json.state }}"; @@ -1191,7 +1235,7 @@ void NSPanel::register_to_home_assistant() { MQTT_Manager::publish(this->_mqtt_sensor_temperature_topic, temperature_sensor_data_str, true); // Register relay1 - if (this->_register_relay1_as_light == NSPanelSettings::RelayRegisterType::NSPanelSettings_RelayRegisterType_SWITCH) { + if (this->_register_relay1_as_light == NSPanelSettings::RelayRegisterType::NSPanelSettings_RelayRegisterType_SWITCH) { nlohmann::json relay1_data = nlohmann::json(base_json); relay1_data["device_class"] = "switch"; relay1_data["name"] = "Relay 1"; @@ -1223,7 +1267,7 @@ void NSPanel::register_to_home_assistant() { } // Register relay2 - if (this->_register_relay2_as_light == NSPanelSettings::RelayRegisterType::NSPanelSettings_RelayRegisterType_SWITCH) { + if (this->_register_relay2_as_light == NSPanelSettings::RelayRegisterType::NSPanelSettings_RelayRegisterType_SWITCH) { nlohmann::json relay2_data = nlohmann::json(base_json); relay2_data["device_class"] = "switch"; relay2_data["name"] = "Relay 2"; @@ -1325,40 +1369,36 @@ void NSPanel::command_callback(NSPanelMQTTManagerCommand &command) { SPDLOG_DEBUG("NSPanel {}::{} got button {} press,", this->_id, this->_name, command.button_pressed().button_id()); if (command.button_pressed().button_id() == 1) { - ButtonMode button_mode = static_cast(this->_settings.button1_mode); - switch (button_mode) { - case ButtonMode::DETACHED: { - if (this->_settings.button1_detached_mode_entity_id.has_value()) { - auto entity = EntityManager::get_entity_by_id(MQTT_MANAGER_ENTITY_TYPE::ANY, this->_settings.button1_detached_mode_entity_id.value()); - if (entity) { - if ((*entity)->can_toggle()) { - (*entity)->toggle(); - } - } else - SPDLOG_ERROR("Tried to toggle detached light via panel but no light was was found with configured ID."); - } else { - SPDLOG_ERROR("Tried to toggle detached light via panel but no light was configured for button."); - } - break; - } - - case ButtonMode::MQTT_PAYLOAD: { - std::string topic = this->_get_nspanel_setting_with_default("button1_mqtt_topic", ""); - std::string payload = this->_get_nspanel_setting_with_default("button1_mqtt_payload", ""); - MQTT_Manager::publish(topic, payload); - break; - } - - default: - SPDLOG_WARN("Unknown button mode triggered from panel."); - break; - } + handle_button_pressed_command_callback( static_cast(this->_settings.button1_mode), this->_settings.button1_detached_mode_entity_id, + this->_get_nspanel_setting_with_default("button1_mqtt_topic", ""), this->_get_nspanel_setting_with_default("button1_mqtt_payload", "")); } else if (command.button_pressed().button_id() == 2) { - ButtonMode button_mode = static_cast(this->_settings.button2_mode); + handle_button_pressed_command_callback( static_cast(this->_settings.button2_mode), this->_settings.button2_detached_mode_entity_id, + this->_get_nspanel_setting_with_default("button2_mqtt_topic", ""), this->_get_nspanel_setting_with_default("button2_mqtt_payload", "")); + + } + } + } + if (command.has_button_longpressed()) { + if (command.nspanel_id() == this->_id) { + SPDLOG_DEBUG("NSPanel {}::{} got button {} longpress,", this->_id, this->_name, command.button_longpressed().button_id()); + + if (command.button_longpressed().button_id() == 1) { + handle_button_pressed_command_callback( static_cast(this->_settings.button1_long_mode), this->_settings.button1_long_detached_mode_entity_id, + this->_get_nspanel_setting_with_default("button1_long_mqtt_topic", ""), this->_get_nspanel_setting_with_default("button1_long_mqtt_payload", "")); + } else if (command.button_longpressed().button_id() == 2) { + handle_button_pressed_command_callback( static_cast(this->_settings.button2_long_mode), this->_settings.button2_long_detached_mode_entity_id, + this->_get_nspanel_setting_with_default("button2_long_mqtt_topic", ""), this->_get_nspanel_setting_with_default("button2_long_mqtt_payload", "")); + + } + } + } +} + +void NSPanel::handle_button_pressed_command_callback(NSPanelConfig::NSPanelButtonMode button_mode, std::optional entity_id, std::string topic,std::string payload ) { switch (button_mode) { - case ButtonMode::DETACHED: { - if (this->_settings.button2_detached_mode_entity_id.has_value()) { - auto entity = EntityManager::get_entity_by_id(MQTT_MANAGER_ENTITY_TYPE::ANY, this->_settings.button2_detached_mode_entity_id.value()); + case NSPanelSettings::DETACHED_MODE: { + if (entity_id.has_value()) { + auto entity = EntityManager::get_entity_by_id(MQTT_MANAGER_ENTITY_TYPE::ANY, entity_id.value()); if (entity) { if ((*entity)->can_toggle()) { (*entity)->toggle(); @@ -1371,9 +1411,7 @@ void NSPanel::command_callback(NSPanelMQTTManagerCommand &command) { break; } - case ButtonMode::MQTT_PAYLOAD: { - std::string topic = this->_get_nspanel_setting_with_default("button2_mqtt_topic", ""); - std::string payload = this->_get_nspanel_setting_with_default("button2_mqtt_payload", ""); + case NSPanelSettings::CUSTOM_MQTT: { MQTT_Manager::publish(topic, payload); break; } @@ -1383,9 +1421,6 @@ void NSPanel::command_callback(NSPanelMQTTManagerCommand &command) { break; } } - } - } -} void NSPanel::handle_stomp_command_callback(StompFrame frame) { if (frame.body.compare("reboot") == 0) { diff --git a/docker/MQTTManager/include/nspanel/nspanel.hpp b/docker/MQTTManager/include/nspanel/nspanel.hpp index 3c9cb183..39850d73 100644 --- a/docker/MQTTManager/include/nspanel/nspanel.hpp +++ b/docker/MQTTManager/include/nspanel/nspanel.hpp @@ -34,10 +34,13 @@ struct NSPanelWarningWebsocketRepresentation { std::string text; }; + class NSPanel { + public: NSPanel(uint32_t panel_id); + /* * Build a new NSPanel object from a discovery request and add it to the database as pending. * Returns a shared_ptr to the new NSPanel object if successful, otherwill nullptr. @@ -155,6 +158,12 @@ class NSPanel { */ void command_callback(NSPanelMQTTManagerCommand &command); + + /* + * handle button presses + */ + void handle_button_pressed_command_callback(NSPanelConfig::NSPanelButtonMode button_mode, std::optional entity_id, std::string topic,std::string payload ); + /** * When an IPC request for NSPanel status comes in handle it and send the response back */ @@ -179,6 +188,7 @@ class NSPanel { std::mutex _settings_mutex; // Mutex to only allow access to _settings for one thread at the time std::string _mac; std::string _name; + std::string _version; bool _is_us_panel; enum US_PANEL_ORIENTATION { LANDSCAPE_LEFT, @@ -201,14 +211,7 @@ class NSPanel { std::string _current_littlefs_md5_checksum; std::string _current_tft_md5_checksum; - enum ButtonMode { - DIRECT, - DETACHED, - MQTT_PAYLOAD, - FOLLOW, - THERMOSTAT_HEATING, - THERMOSTAT_COOLING, - }; + // MQTT Stuff: // Wether or not relay1 should be registered to Home Assistant as a switch or light. diff --git a/docker/MQTTManager/include/protobuf/protobuf_mqttmanager.pb.cc b/docker/MQTTManager/include/protobuf/protobuf_mqttmanager.pb.cc index ccd049a3..eaae72ef 100644 --- a/docker/MQTTManager/include/protobuf/protobuf_mqttmanager.pb.cc +++ b/docker/MQTTManager/include/protobuf/protobuf_mqttmanager.pb.cc @@ -49,6 +49,18 @@ inline constexpr NSPanelSettings::Impl_::Impl_( button2_mqtt_payload_( &::google::protobuf::internal::fixed_address_empty_string, ::_pbi::ConstantInitialized()), + button1_long_mqtt_topic_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + button2_long_mqtt_topic_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + button1_long_mqtt_payload_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + button2_long_mqtt_payload_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), ip_address_( &::google::protobuf::internal::fixed_address_empty_string, ::_pbi::ConstantInitialized()), @@ -72,12 +84,20 @@ inline constexpr NSPanelSettings::Impl_::Impl_( relay1_default_mode_{false}, temperature_calibration_{0}, button1_mode_{static_cast< ::NSPanelSettings_NSPanelButtonMode >(0)}, + button1_fallback_{static_cast< ::NSPanelSettings_NSPanelButtonFallbackMode >(0)}, button2_mode_{static_cast< ::NSPanelSettings_NSPanelButtonMode >(0)}, + button2_fallback_{static_cast< ::NSPanelSettings_NSPanelButtonFallbackMode >(0)}, + button1_long_mode_{static_cast< ::NSPanelSettings_NSPanelButtonMode >(0)}, + button1_long_fallback_{static_cast< ::NSPanelSettings_NSPanelButtonFallbackMode >(0)}, + button2_long_mode_{static_cast< ::NSPanelSettings_NSPanelButtonMode >(0)}, + button2_long_fallback_{static_cast< ::NSPanelSettings_NSPanelButtonFallbackMode >(0)}, button1_detached_light_id_{0}, - button2_detached_light_id_{0}, relay2_default_mode_{false}, denied_{false}, accepted_{false}, + button2_detached_light_id_{0}, + button1_long_detached_light_id_{0}, + button2_long_detached_light_id_{0}, relay1_register_type_{static_cast< ::NSPanelSettings_RelayRegisterType >(0)}, relay2_register_type_{static_cast< ::NSPanelSettings_RelayRegisterType >(0)}, default_room_{0} {} @@ -114,7 +134,7 @@ struct MultipleNSPanelsSettingsDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MultipleNSPanelsSettingsDefaultTypeInternal _MultipleNSPanelsSettings_default_instance_; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_protobuf_5fmqttmanager_2eproto[4]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_protobuf_5fmqttmanager_2eproto[5]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_protobuf_5fmqttmanager_2eproto = nullptr; const ::uint32_t @@ -151,13 +171,25 @@ const ::uint32_t PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.relay2_default_mode_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.temperature_calibration_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button1_mode_), + PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button1_fallback_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button2_mode_), + PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button2_fallback_), + PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button1_long_mode_), + PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button1_long_fallback_), + PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button2_long_mode_), + PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button2_long_fallback_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button1_mqtt_topic_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button2_mqtt_topic_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button1_mqtt_payload_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button2_mqtt_payload_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button1_detached_light_id_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button2_detached_light_id_), + PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button1_long_mqtt_topic_), + PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button2_long_mqtt_topic_), + PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button1_long_mqtt_payload_), + PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button2_long_mqtt_payload_), + PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button1_long_detached_light_id_), + PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.button2_long_detached_light_id_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.denied_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.accepted_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.rooms_), @@ -166,7 +198,13 @@ const ::uint32_t PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.relay1_register_type_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.relay2_register_type_), PROTOBUF_FIELD_OFFSET(::NSPanelSettings, _impl_.default_room_), - 4, + 8, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, ~0u, ~0u, ~0u, @@ -194,8 +232,14 @@ const ::uint32_t 1, 2, 3, + 9, + 10, + 4, 5, 6, + 7, + 11, + 12, ~0u, ~0u, ~0u, @@ -217,8 +261,8 @@ const ::uint32_t static const ::_pbi::MigrationSchema schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - {0, 46, -1, sizeof(::NSPanelSettings)}, - {84, -1, -1, sizeof(::MultipleNSPanelsSettings)}, + {0, 58, -1, sizeof(::NSPanelSettings)}, + {108, -1, -1, sizeof(::MultipleNSPanelsSettings)}, }; static const ::_pb::Message* const file_default_instances[] = { &::_NSPanelSettings_default_instance_._instance, @@ -227,7 +271,7 @@ static const ::_pb::Message* const file_default_instances[] = { const char descriptor_table_protodef_protobuf_5fmqttmanager_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE( protodesc_cold) = { "\n\032protobuf_mqttmanager.proto\032\026protobuf_f" - "ormats.proto\"\246\016\n\017NSPanelSettings\022\017\n\002id\030\001" + "ormats.proto\"\307\025\n\017NSPanelSettings\022\017\n\002id\030\001" " \001(\005H\000\210\001\001\022\023\n\013mac_address\030\002 \001(\t\022\014\n\004name\030\003" " \001(\t\022\014\n\004home\030\004 \001(\005\0229\n\014default_page\030\005 \001(\016" "2#.NSPanelSettings.NSPanelDefaultPage\022 \n" @@ -245,36 +289,60 @@ const char descriptor_table_protodef_protobuf_5fmqttmanager_2eproto[] ABSL_ATTRI "to_default_room\030\026 \001(\010\022\026\n\016reverse_relays\030" "\027 \001(\010\022\033\n\023relay1_default_mode\030\030 \001(\010\022\033\n\023re" "lay2_default_mode\030\031 \001(\010\022\037\n\027temperature_c" - "alibration\030\032 \001(\005\0228\n\014button1_mode\030\033 \001(\0162\"" - ".NSPanelSettings.NSPanelButtonMode\0228\n\014bu" - "tton2_mode\030\034 \001(\0162\".NSPanelSettings.NSPan" - "elButtonMode\022\037\n\022button1_mqtt_topic\030\035 \001(\t" - "H\001\210\001\001\022\037\n\022button2_mqtt_topic\030\036 \001(\tH\002\210\001\001\022!" - "\n\024button1_mqtt_payload\030\037 \001(\tH\003\210\001\001\022!\n\024but" - "ton2_mqtt_payload\030 \001(\tH\004\210\001\001\022&\n\031button1_" - "detached_light_id\030! \001(\005H\005\210\001\001\022&\n\031button2_" - "detached_light_id\030\" \001(\005H\006\210\001\001\022\016\n\006denied\030-" - " \001(\010\022\020\n\010accepted\030. \001(\010\022\r\n\005rooms\030/ \003(\005\022\016\n" - "\006scenes\0300 \003(\005\022\022\n\nip_address\0301 \001(\t\022@\n\024rel" - "ay1_register_type\0302 \001(\0162\".NSPanelSetting" - "s.RelayRegisterType\022@\n\024relay2_register_t" - "ype\0303 \001(\0162\".NSPanelSettings.RelayRegiste" - "rType\022\024\n\014default_room\0304 \001(\005\"C\n\022NSPanelDe" - "faultPage\022\r\n\tMAIN_PAGE\020\000\022\017\n\013SCENES_PAGE\020" - "\001\022\r\n\tROOM_PAGE\020\002\"\250\001\n\026NSPanelScreensaverM" - "ode\022\033\n\027WEATHER_WITH_BACKGROUND\020\000\022\036\n\032WEAT" - "HER_WITHOUT_BACKGROUND\020\001\022\034\n\030DATETIME_WIT" - "H_BACKGROUND\020\003\022\037\n\033DATETIME_WITHOUT_BACKG" - "ROUND\020\004\022\022\n\016NO_SCREENSAVER\020\005\"Y\n\021NSPanelBu" - "ttonMode\022\017\n\013DIRECT_MODE\020\000\022\021\n\rDETACHED_MO" - "DE\020\001\022\017\n\013CUSTOM_MQTT\020\002\022\017\n\013FOLLOW_MODE\020\003\"*" - "\n\021RelayRegisterType\022\n\n\006SWITCH\020\000\022\t\n\005LIGHT" - "\020\001B\005\n\003_idB\025\n\023_button1_mqtt_topicB\025\n\023_but" - "ton2_mqtt_topicB\027\n\025_button1_mqtt_payload" - "B\027\n\025_button2_mqtt_payloadB\034\n\032_button1_de" - "tached_light_idB\034\n\032_button2_detached_lig" - "ht_id\">\n\030MultipleNSPanelsSettings\022\"\n\010nsp" - "anels\030\001 \003(\0132\020.NSPanelSettingsb\006proto3" + "alibration\030\032 \001(\005\0228\n\014button1_mode\030\036 \001(\0162\"" + ".NSPanelSettings.NSPanelButtonMode\022D\n\020bu" + "tton1_fallback\030\037 \001(\0162*.NSPanelSettings.N" + "SPanelButtonFallbackMode\0228\n\014button2_mode" + "\030 \001(\0162\".NSPanelSettings.NSPanelButtonMo" + "de\022D\n\020button2_fallback\030! \001(\0162*.NSPanelSe" + "ttings.NSPanelButtonFallbackMode\022=\n\021butt" + "on1_long_mode\030\" \001(\0162\".NSPanelSettings.NS" + "PanelButtonMode\022I\n\025button1_long_fallback" + "\030# \001(\0162*.NSPanelSettings.NSPanelButtonFa" + "llbackMode\022=\n\021button2_long_mode\030$ \001(\0162\"." + "NSPanelSettings.NSPanelButtonMode\022I\n\025but" + "ton2_long_fallback\030% \001(\0162*.NSPanelSettin" + "gs.NSPanelButtonFallbackMode\022\037\n\022button1_" + "mqtt_topic\030& \001(\tH\001\210\001\001\022\037\n\022button2_mqtt_to" + "pic\030\' \001(\tH\002\210\001\001\022!\n\024button1_mqtt_payload\030(" + " \001(\tH\003\210\001\001\022!\n\024button2_mqtt_payload\030) \001(\tH" + "\004\210\001\001\022&\n\031button1_detached_light_id\030* \001(\005H" + "\005\210\001\001\022&\n\031button2_detached_light_id\030+ \001(\005H" + "\006\210\001\001\022$\n\027button1_long_mqtt_topic\030, \001(\tH\007\210" + "\001\001\022$\n\027button2_long_mqtt_topic\030- \001(\tH\010\210\001\001" + "\022&\n\031button1_long_mqtt_payload\030. \001(\tH\t\210\001\001" + "\022&\n\031button2_long_mqtt_payload\030/ \001(\tH\n\210\001\001" + "\022+\n\036button1_long_detached_light_id\0300 \001(\005" + "H\013\210\001\001\022+\n\036button2_long_detached_light_id\030" + "1 \001(\005H\014\210\001\001\022\016\n\006denied\0302 \001(\010\022\020\n\010accepted\0303" + " \001(\010\022\r\n\005rooms\0304 \003(\005\022\016\n\006scenes\0305 \003(\005\022\022\n\ni" + "p_address\0306 \001(\t\022@\n\024relay1_register_type\030" + "7 \001(\0162\".NSPanelSettings.RelayRegisterTyp" + "e\022@\n\024relay2_register_type\0308 \001(\0162\".NSPane" + "lSettings.RelayRegisterType\022\024\n\014default_r" + "oom\0309 \001(\005\"C\n\022NSPanelDefaultPage\022\r\n\tMAIN_" + "PAGE\020\000\022\017\n\013SCENES_PAGE\020\001\022\r\n\tROOM_PAGE\020\002\"\250" + "\001\n\026NSPanelScreensaverMode\022\033\n\027WEATHER_WIT" + "H_BACKGROUND\020\000\022\036\n\032WEATHER_WITHOUT_BACKGR" + "OUND\020\001\022\034\n\030DATETIME_WITH_BACKGROUND\020\003\022\037\n\033" + "DATETIME_WITHOUT_BACKGROUND\020\004\022\022\n\016NO_SCRE" + "ENSAVER\020\005\"Y\n\021NSPanelButtonMode\022\017\n\013DIRECT" + "_MODE\020\000\022\021\n\rDETACHED_MODE\020\001\022\017\n\013CUSTOM_MQT" + "T\020\002\022\017\n\013FOLLOW_MODE\020\003\"O\n\031NSPanelButtonFal" + "lbackMode\022\014\n\010DISABLED\020\000\022\021\n\rTOGGLE_RELAY1" + "\020\001\022\021\n\rTOGLLE_RELAY2\020\002\"*\n\021RelayRegisterTy" + "pe\022\n\n\006SWITCH\020\000\022\t\n\005LIGHT\020\001B\005\n\003_idB\025\n\023_but" + "ton1_mqtt_topicB\025\n\023_button2_mqtt_topicB\027" + "\n\025_button1_mqtt_payloadB\027\n\025_button2_mqtt" + "_payloadB\034\n\032_button1_detached_light_idB\034" + "\n\032_button2_detached_light_idB\032\n\030_button1" + "_long_mqtt_topicB\032\n\030_button2_long_mqtt_t" + "opicB\034\n\032_button1_long_mqtt_payloadB\034\n\032_b" + "utton2_long_mqtt_payloadB!\n\037_button1_lon" + "g_detached_light_idB!\n\037_button2_long_det" + "ached_light_id\">\n\030MultipleNSPanelsSettin" + "gs\022\"\n\010nspanels\030\001 \003(\0132\020.NSPanelSettingsb\006" + "proto3" }; static const ::_pbi::DescriptorTable* const descriptor_table_protobuf_5fmqttmanager_2eproto_deps[1] = { @@ -284,7 +352,7 @@ static ::absl::once_flag descriptor_table_protobuf_5fmqttmanager_2eproto_once; PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_protobuf_5fmqttmanager_2eproto = { false, false, - 1957, + 2886, descriptor_table_protodef_protobuf_5fmqttmanager_2eproto, "protobuf_mqttmanager.proto", &descriptor_table_protobuf_5fmqttmanager_2eproto_once, @@ -363,10 +431,31 @@ constexpr int NSPanelSettings::NSPanelButtonMode_ARRAYSIZE; #endif // (__cplusplus < 201703) && // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::google::protobuf::EnumDescriptor* NSPanelSettings_RelayRegisterType_descriptor() { +const ::google::protobuf::EnumDescriptor* NSPanelSettings_NSPanelButtonFallbackMode_descriptor() { ::google::protobuf::internal::AssignDescriptors(&descriptor_table_protobuf_5fmqttmanager_2eproto); return file_level_enum_descriptors_protobuf_5fmqttmanager_2eproto[3]; } +PROTOBUF_CONSTINIT const uint32_t NSPanelSettings_NSPanelButtonFallbackMode_internal_data_[] = { + 196608u, 0u, }; +bool NSPanelSettings_NSPanelButtonFallbackMode_IsValid(int value) { + return 0 <= value && value <= 2; +} +#if (__cplusplus < 201703) && \ + (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) + +constexpr NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings::DISABLED; +constexpr NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings::TOGGLE_RELAY1; +constexpr NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings::TOGLLE_RELAY2; +constexpr NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings::NSPanelButtonFallbackMode_MIN; +constexpr NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings::NSPanelButtonFallbackMode_MAX; +constexpr int NSPanelSettings::NSPanelButtonFallbackMode_ARRAYSIZE; + +#endif // (__cplusplus < 201703) && + // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::google::protobuf::EnumDescriptor* NSPanelSettings_RelayRegisterType_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_protobuf_5fmqttmanager_2eproto); + return file_level_enum_descriptors_protobuf_5fmqttmanager_2eproto[4]; +} PROTOBUF_CONSTINIT const uint32_t NSPanelSettings_RelayRegisterType_internal_data_[] = { 131072u, 0u, }; bool NSPanelSettings_RelayRegisterType_IsValid(int value) { @@ -413,6 +502,10 @@ inline PROTOBUF_NDEBUG_INLINE NSPanelSettings::Impl_::Impl_( button2_mqtt_topic_(arena, from.button2_mqtt_topic_), button1_mqtt_payload_(arena, from.button1_mqtt_payload_), button2_mqtt_payload_(arena, from.button2_mqtt_payload_), + button1_long_mqtt_topic_(arena, from.button1_long_mqtt_topic_), + button2_long_mqtt_topic_(arena, from.button2_long_mqtt_topic_), + button1_long_mqtt_payload_(arena, from.button1_long_mqtt_payload_), + button2_long_mqtt_payload_(arena, from.button2_long_mqtt_payload_), ip_address_(arena, from.ip_address_) {} NSPanelSettings::NSPanelSettings( @@ -448,6 +541,10 @@ inline PROTOBUF_NDEBUG_INLINE NSPanelSettings::Impl_::Impl_( button2_mqtt_topic_(arena), button1_mqtt_payload_(arena), button2_mqtt_payload_(arena), + button1_long_mqtt_topic_(arena), + button2_long_mqtt_topic_(arena), + button1_long_mqtt_payload_(arena), + button2_long_mqtt_payload_(arena), ip_address_(arena) {} inline void NSPanelSettings::SharedCtor(::_pb::Arena* arena) { @@ -472,6 +569,10 @@ inline void NSPanelSettings::SharedDtor() { _impl_.button2_mqtt_topic_.Destroy(); _impl_.button1_mqtt_payload_.Destroy(); _impl_.button2_mqtt_payload_.Destroy(); + _impl_.button1_long_mqtt_topic_.Destroy(); + _impl_.button2_long_mqtt_topic_.Destroy(); + _impl_.button1_long_mqtt_payload_.Destroy(); + _impl_.button2_long_mqtt_payload_.Destroy(); _impl_.ip_address_.Destroy(); _impl_.~Impl_(); } @@ -497,15 +598,15 @@ NSPanelSettings::GetClassData() const { return _data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<5, 38, 0, 157, 9> NSPanelSettings::_table_ = { +const ::_pbi::TcParseTable<5, 50, 0, 269, 9> NSPanelSettings::_table_ = { { PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_._has_bits_), 0, // no _extensions_ - 52, 248, // max_field_number, fast_idx_mask + 57, 248, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 8640, // skipmap + 469770688, // skipmap offsetof(decltype(_table_), field_entries), - 38, // num_field_entries + 50, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries &_NSPanelSettings_default_instance_._instance, @@ -517,8 +618,8 @@ const ::_pbi::TcParseTable<5, 38, 0, 157, 9> NSPanelSettings::_table_ = { }, {{ {::_pbi::TcParser::MiniParse, {}}, // optional int32 id = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(NSPanelSettings, _impl_.id_), 4>(), - {8, 4, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.id_)}}, + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(NSPanelSettings, _impl_.id_), 8>(), + {8, 8, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.id_)}}, // string mac_address = 2; {::_pbi::TcParser::FastUS1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.mac_address_)}}, @@ -586,28 +687,28 @@ const ::_pbi::TcParseTable<5, 38, 0, 157, 9> NSPanelSettings::_table_ = { // int32 temperature_calibration = 26; {::_pbi::TcParser::FastV32S2, {464, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.temperature_calibration_)}}, - // .NSPanelSettings.NSPanelButtonMode button1_mode = 27; + // optional int32 button2_detached_light_id = 43; {::_pbi::TcParser::FastV32S2, - {472, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_mode_)}}, - // .NSPanelSettings.NSPanelButtonMode button2_mode = 28; - {::_pbi::TcParser::FastV32S2, - {480, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_mode_)}}, - // optional string button1_mqtt_topic = 29; - {::_pbi::TcParser::FastUS2, - {490, 0, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_mqtt_topic_)}}, - // optional string button2_mqtt_topic = 30; + {728, 10, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_detached_light_id_)}}, + // optional string button1_long_mqtt_topic = 44; {::_pbi::TcParser::FastUS2, - {498, 1, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_mqtt_topic_)}}, - // optional string button1_mqtt_payload = 31; + {738, 4, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_long_mqtt_topic_)}}, + // optional string button2_long_mqtt_topic = 45; {::_pbi::TcParser::FastUS2, - {506, 2, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_mqtt_payload_)}}, + {746, 5, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_long_mqtt_topic_)}}, + // .NSPanelSettings.NSPanelButtonMode button1_mode = 30; + {::_pbi::TcParser::FastV32S2, + {496, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_mode_)}}, + // .NSPanelSettings.NSPanelButtonFallbackMode button1_fallback = 31; + {::_pbi::TcParser::FastV32S2, + {504, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_fallback_)}}, }}, {{ 33, 0, 2, - 4092, 28, 65520, 34, + 0, 25, 65024, 41, 65535, 65535 }}, {{ // optional int32 id = 1; - {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.id_), _Internal::kHasBitsOffset + 4, 0, + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.id_), _Internal::kHasBitsOffset + 8, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, // string mac_address = 2; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.mac_address_), -1, 0, @@ -672,58 +773,94 @@ const ::_pbi::TcParseTable<5, 38, 0, 157, 9> NSPanelSettings::_table_ = { // int32 temperature_calibration = 26; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.temperature_calibration_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kInt32)}, - // .NSPanelSettings.NSPanelButtonMode button1_mode = 27; + // .NSPanelSettings.NSPanelButtonMode button1_mode = 30; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_mode_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // .NSPanelSettings.NSPanelButtonMode button2_mode = 28; + // .NSPanelSettings.NSPanelButtonFallbackMode button1_fallback = 31; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_fallback_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // .NSPanelSettings.NSPanelButtonMode button2_mode = 32; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_mode_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // optional string button1_mqtt_topic = 29; + // .NSPanelSettings.NSPanelButtonFallbackMode button2_fallback = 33; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_fallback_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // .NSPanelSettings.NSPanelButtonMode button1_long_mode = 34; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_long_mode_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // .NSPanelSettings.NSPanelButtonFallbackMode button1_long_fallback = 35; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_long_fallback_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // .NSPanelSettings.NSPanelButtonMode button2_long_mode = 36; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_long_mode_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // .NSPanelSettings.NSPanelButtonFallbackMode button2_long_fallback = 37; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_long_fallback_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // optional string button1_mqtt_topic = 38; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_mqtt_topic_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional string button2_mqtt_topic = 30; + // optional string button2_mqtt_topic = 39; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_mqtt_topic_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional string button1_mqtt_payload = 31; + // optional string button1_mqtt_payload = 40; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_mqtt_payload_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional string button2_mqtt_payload = 32; + // optional string button2_mqtt_payload = 41; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_mqtt_payload_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // optional int32 button1_detached_light_id = 33; - {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_detached_light_id_), _Internal::kHasBitsOffset + 5, 0, + // optional int32 button1_detached_light_id = 42; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_detached_light_id_), _Internal::kHasBitsOffset + 9, 0, + (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + // optional int32 button2_detached_light_id = 43; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_detached_light_id_), _Internal::kHasBitsOffset + 10, 0, + (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + // optional string button1_long_mqtt_topic = 44; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_long_mqtt_topic_), _Internal::kHasBitsOffset + 4, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional string button2_long_mqtt_topic = 45; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_long_mqtt_topic_), _Internal::kHasBitsOffset + 5, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional string button1_long_mqtt_payload = 46; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_long_mqtt_payload_), _Internal::kHasBitsOffset + 6, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional string button2_long_mqtt_payload = 47; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_long_mqtt_payload_), _Internal::kHasBitsOffset + 7, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional int32 button1_long_detached_light_id = 48; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button1_long_detached_light_id_), _Internal::kHasBitsOffset + 11, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, - // optional int32 button2_detached_light_id = 34; - {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_detached_light_id_), _Internal::kHasBitsOffset + 6, 0, + // optional int32 button2_long_detached_light_id = 49; + {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.button2_long_detached_light_id_), _Internal::kHasBitsOffset + 12, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, - // bool denied = 45; + // bool denied = 50; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.denied_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // bool accepted = 46; + // bool accepted = 51; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.accepted_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // repeated int32 rooms = 47; + // repeated int32 rooms = 52; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.rooms_), -1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kPackedInt32)}, - // repeated int32 scenes = 48; + // repeated int32 scenes = 53; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.scenes_), -1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kPackedInt32)}, - // string ip_address = 49; + // string ip_address = 54; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.ip_address_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .NSPanelSettings.RelayRegisterType relay1_register_type = 50; + // .NSPanelSettings.RelayRegisterType relay1_register_type = 55; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.relay1_register_type_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // .NSPanelSettings.RelayRegisterType relay2_register_type = 51; + // .NSPanelSettings.RelayRegisterType relay2_register_type = 56; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.relay2_register_type_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // int32 default_room = 52; + // int32 default_room = 57; {PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.default_room_), -1, 0, (0 | ::_fl::kFcSingular | ::_fl::kInt32)}, }}, // no aux_entries {{ - "\17\0\13\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\24\24\0\0\0\0\0\0\12\0\0\0\0" + "\17\0\13\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\22\22\24\24\0\0\27\27\31\31\0\0\0\0\0\0\12\0\0\0\0\0\0\0\0" "NSPanelSettings" "mac_address" "name" @@ -731,6 +868,10 @@ const ::_pbi::TcParseTable<5, 38, 0, 157, 9> NSPanelSettings::_table_ = { "button2_mqtt_topic" "button1_mqtt_payload" "button2_mqtt_payload" + "button1_long_mqtt_topic" + "button2_long_mqtt_topic" + "button1_long_mqtt_payload" + "button2_long_mqtt_payload" "ip_address" }}, }; @@ -747,7 +888,7 @@ PROTOBUF_NOINLINE void NSPanelSettings::Clear() { _impl_.mac_address_.ClearToEmpty(); _impl_.name_.ClearToEmpty(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x000000ffu) { if (cached_has_bits & 0x00000001u) { _impl_.button1_mqtt_topic_.ClearNonDefaultToEmpty(); } @@ -760,20 +901,36 @@ PROTOBUF_NOINLINE void NSPanelSettings::Clear() { if (cached_has_bits & 0x00000008u) { _impl_.button2_mqtt_payload_.ClearNonDefaultToEmpty(); } + if (cached_has_bits & 0x00000010u) { + _impl_.button1_long_mqtt_topic_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000020u) { + _impl_.button2_long_mqtt_topic_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000040u) { + _impl_.button1_long_mqtt_payload_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000080u) { + _impl_.button2_long_mqtt_payload_.ClearNonDefaultToEmpty(); + } } _impl_.ip_address_.ClearToEmpty(); _impl_.id_ = 0; ::memset(&_impl_.home_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.button2_mode_) - - reinterpret_cast(&_impl_.home_)) + sizeof(_impl_.button2_mode_)); - if (cached_has_bits & 0x00000060u) { - ::memset(&_impl_.button1_detached_light_id_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.button2_detached_light_id_) - - reinterpret_cast(&_impl_.button1_detached_light_id_)) + sizeof(_impl_.button2_detached_light_id_)); - } + reinterpret_cast(&_impl_.button2_long_fallback_) - + reinterpret_cast(&_impl_.home_)) + sizeof(_impl_.button2_long_fallback_)); + _impl_.button1_detached_light_id_ = 0; ::memset(&_impl_.relay2_default_mode_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.accepted_) - + reinterpret_cast(&_impl_.relay2_default_mode_)) + sizeof(_impl_.accepted_)); + if (cached_has_bits & 0x00001c00u) { + ::memset(&_impl_.button2_detached_light_id_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.button2_long_detached_light_id_) - + reinterpret_cast(&_impl_.button2_detached_light_id_)) + sizeof(_impl_.button2_long_detached_light_id_)); + } + ::memset(&_impl_.relay1_register_type_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.default_room_) - - reinterpret_cast(&_impl_.relay2_default_mode_)) + sizeof(_impl_.default_room_)); + reinterpret_cast(&_impl_.relay1_register_type_)) + sizeof(_impl_.default_room_)); _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -787,7 +944,7 @@ ::uint8_t* NSPanelSettings::_InternalSerialize( cached_has_bits = _impl_._has_bits_[0]; // optional int32 id = 1; - if (cached_has_bits & 0x00000010u) { + if (cached_has_bits & 0x00000100u) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArrayWithField<1>( stream, this->_internal_id(), target); @@ -942,125 +1099,213 @@ ::uint8_t* NSPanelSettings::_InternalSerialize( 26, this->_internal_temperature_calibration(), target); } - // .NSPanelSettings.NSPanelButtonMode button1_mode = 27; + // .NSPanelSettings.NSPanelButtonMode button1_mode = 30; if (this->_internal_button1_mode() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 27, this->_internal_button1_mode(), target); + 30, this->_internal_button1_mode(), target); } - // .NSPanelSettings.NSPanelButtonMode button2_mode = 28; + // .NSPanelSettings.NSPanelButtonFallbackMode button1_fallback = 31; + if (this->_internal_button1_fallback() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 31, this->_internal_button1_fallback(), target); + } + + // .NSPanelSettings.NSPanelButtonMode button2_mode = 32; if (this->_internal_button2_mode() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 28, this->_internal_button2_mode(), target); + 32, this->_internal_button2_mode(), target); + } + + // .NSPanelSettings.NSPanelButtonFallbackMode button2_fallback = 33; + if (this->_internal_button2_fallback() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 33, this->_internal_button2_fallback(), target); + } + + // .NSPanelSettings.NSPanelButtonMode button1_long_mode = 34; + if (this->_internal_button1_long_mode() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 34, this->_internal_button1_long_mode(), target); + } + + // .NSPanelSettings.NSPanelButtonFallbackMode button1_long_fallback = 35; + if (this->_internal_button1_long_fallback() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 35, this->_internal_button1_long_fallback(), target); + } + + // .NSPanelSettings.NSPanelButtonMode button2_long_mode = 36; + if (this->_internal_button2_long_mode() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 36, this->_internal_button2_long_mode(), target); + } + + // .NSPanelSettings.NSPanelButtonFallbackMode button2_long_fallback = 37; + if (this->_internal_button2_long_fallback() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 37, this->_internal_button2_long_fallback(), target); } - // optional string button1_mqtt_topic = 29; + // optional string button1_mqtt_topic = 38; if (cached_has_bits & 0x00000001u) { const std::string& _s = this->_internal_button1_mqtt_topic(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "NSPanelSettings.button1_mqtt_topic"); - target = stream->WriteStringMaybeAliased(29, _s, target); + target = stream->WriteStringMaybeAliased(38, _s, target); } - // optional string button2_mqtt_topic = 30; + // optional string button2_mqtt_topic = 39; if (cached_has_bits & 0x00000002u) { const std::string& _s = this->_internal_button2_mqtt_topic(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "NSPanelSettings.button2_mqtt_topic"); - target = stream->WriteStringMaybeAliased(30, _s, target); + target = stream->WriteStringMaybeAliased(39, _s, target); } - // optional string button1_mqtt_payload = 31; + // optional string button1_mqtt_payload = 40; if (cached_has_bits & 0x00000004u) { const std::string& _s = this->_internal_button1_mqtt_payload(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "NSPanelSettings.button1_mqtt_payload"); - target = stream->WriteStringMaybeAliased(31, _s, target); + target = stream->WriteStringMaybeAliased(40, _s, target); } - // optional string button2_mqtt_payload = 32; + // optional string button2_mqtt_payload = 41; if (cached_has_bits & 0x00000008u) { const std::string& _s = this->_internal_button2_mqtt_payload(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "NSPanelSettings.button2_mqtt_payload"); - target = stream->WriteStringMaybeAliased(32, _s, target); + target = stream->WriteStringMaybeAliased(41, _s, target); } - // optional int32 button1_detached_light_id = 33; - if (cached_has_bits & 0x00000020u) { + // optional int32 button1_detached_light_id = 42; + if (cached_has_bits & 0x00000200u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteInt32ToArray( - 33, this->_internal_button1_detached_light_id(), target); + 42, this->_internal_button1_detached_light_id(), target); + } + + // optional int32 button2_detached_light_id = 43; + if (cached_has_bits & 0x00000400u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray( + 43, this->_internal_button2_detached_light_id(), target); + } + + // optional string button1_long_mqtt_topic = 44; + if (cached_has_bits & 0x00000010u) { + const std::string& _s = this->_internal_button1_long_mqtt_topic(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "NSPanelSettings.button1_long_mqtt_topic"); + target = stream->WriteStringMaybeAliased(44, _s, target); } - // optional int32 button2_detached_light_id = 34; + // optional string button2_long_mqtt_topic = 45; + if (cached_has_bits & 0x00000020u) { + const std::string& _s = this->_internal_button2_long_mqtt_topic(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "NSPanelSettings.button2_long_mqtt_topic"); + target = stream->WriteStringMaybeAliased(45, _s, target); + } + + // optional string button1_long_mqtt_payload = 46; if (cached_has_bits & 0x00000040u) { + const std::string& _s = this->_internal_button1_long_mqtt_payload(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "NSPanelSettings.button1_long_mqtt_payload"); + target = stream->WriteStringMaybeAliased(46, _s, target); + } + + // optional string button2_long_mqtt_payload = 47; + if (cached_has_bits & 0x00000080u) { + const std::string& _s = this->_internal_button2_long_mqtt_payload(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "NSPanelSettings.button2_long_mqtt_payload"); + target = stream->WriteStringMaybeAliased(47, _s, target); + } + + // optional int32 button1_long_detached_light_id = 48; + if (cached_has_bits & 0x00000800u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray( + 48, this->_internal_button1_long_detached_light_id(), target); + } + + // optional int32 button2_long_detached_light_id = 49; + if (cached_has_bits & 0x00001000u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteInt32ToArray( - 34, this->_internal_button2_detached_light_id(), target); + 49, this->_internal_button2_long_detached_light_id(), target); } - // bool denied = 45; + // bool denied = 50; if (this->_internal_denied() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( - 45, this->_internal_denied(), target); + 50, this->_internal_denied(), target); } - // bool accepted = 46; + // bool accepted = 51; if (this->_internal_accepted() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( - 46, this->_internal_accepted(), target); + 51, this->_internal_accepted(), target); } - // repeated int32 rooms = 47; + // repeated int32 rooms = 52; { int byte_size = _impl_._rooms_cached_byte_size_.Get(); if (byte_size > 0) { target = stream->WriteInt32Packed( - 47, _internal_rooms(), byte_size, target); + 52, _internal_rooms(), byte_size, target); } } - // repeated int32 scenes = 48; + // repeated int32 scenes = 53; { int byte_size = _impl_._scenes_cached_byte_size_.Get(); if (byte_size > 0) { target = stream->WriteInt32Packed( - 48, _internal_scenes(), byte_size, target); + 53, _internal_scenes(), byte_size, target); } } - // string ip_address = 49; + // string ip_address = 54; if (!this->_internal_ip_address().empty()) { const std::string& _s = this->_internal_ip_address(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "NSPanelSettings.ip_address"); - target = stream->WriteStringMaybeAliased(49, _s, target); + target = stream->WriteStringMaybeAliased(54, _s, target); } - // .NSPanelSettings.RelayRegisterType relay1_register_type = 50; + // .NSPanelSettings.RelayRegisterType relay1_register_type = 55; if (this->_internal_relay1_register_type() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 50, this->_internal_relay1_register_type(), target); + 55, this->_internal_relay1_register_type(), target); } - // .NSPanelSettings.RelayRegisterType relay2_register_type = 51; + // .NSPanelSettings.RelayRegisterType relay2_register_type = 56; if (this->_internal_relay2_register_type() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 51, this->_internal_relay2_register_type(), target); + 56, this->_internal_relay2_register_type(), target); } - // int32 default_room = 52; + // int32 default_room = 57; if (this->_internal_default_room() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteInt32ToArray( - 52, this->_internal_default_room(), target); + 57, this->_internal_default_room(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -1081,7 +1326,7 @@ ::size_t NSPanelSettings::ByteSizeLong() const { (void) cached_has_bits; ::_pbi::Prefetch5LinesFrom7Lines(reinterpret_cast(this)); - // repeated int32 rooms = 47; + // repeated int32 rooms = 52; { std::size_t data_size = ::_pbi::WireFormatLite::Int32Size( this->_internal_rooms()) @@ -1094,7 +1339,7 @@ ::size_t NSPanelSettings::ByteSizeLong() const { ; total_size += tag_size + data_size; } - // repeated int32 scenes = 48; + // repeated int32 scenes = 53; { std::size_t data_size = ::_pbi::WireFormatLite::Int32Size( this->_internal_scenes()) @@ -1120,40 +1365,64 @@ ::size_t NSPanelSettings::ByteSizeLong() const { } cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - // optional string button1_mqtt_topic = 29; + if (cached_has_bits & 0x000000ffu) { + // optional string button1_mqtt_topic = 38; if (cached_has_bits & 0x00000001u) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_button1_mqtt_topic()); } - // optional string button2_mqtt_topic = 30; + // optional string button2_mqtt_topic = 39; if (cached_has_bits & 0x00000002u) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_button2_mqtt_topic()); } - // optional string button1_mqtt_payload = 31; + // optional string button1_mqtt_payload = 40; if (cached_has_bits & 0x00000004u) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_button1_mqtt_payload()); } - // optional string button2_mqtt_payload = 32; + // optional string button2_mqtt_payload = 41; if (cached_has_bits & 0x00000008u) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_button2_mqtt_payload()); } + // optional string button1_long_mqtt_topic = 44; + if (cached_has_bits & 0x00000010u) { + total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_button1_long_mqtt_topic()); + } + + // optional string button2_long_mqtt_topic = 45; + if (cached_has_bits & 0x00000020u) { + total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_button2_long_mqtt_topic()); + } + + // optional string button1_long_mqtt_payload = 46; + if (cached_has_bits & 0x00000040u) { + total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_button1_long_mqtt_payload()); + } + + // optional string button2_long_mqtt_payload = 47; + if (cached_has_bits & 0x00000080u) { + total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_button2_long_mqtt_payload()); + } + } - // string ip_address = 49; + // string ip_address = 54; if (!this->_internal_ip_address().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this->_internal_ip_address()); } // optional int32 id = 1; - if (cached_has_bits & 0x00000010u) { + if (cached_has_bits & 0x00000100u) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( this->_internal_id()); } @@ -1262,60 +1531,108 @@ ::size_t NSPanelSettings::ByteSizeLong() const { this->_internal_temperature_calibration()); } - // .NSPanelSettings.NSPanelButtonMode button1_mode = 27; + // .NSPanelSettings.NSPanelButtonMode button1_mode = 30; if (this->_internal_button1_mode() != 0) { total_size += 2 + ::_pbi::WireFormatLite::EnumSize(this->_internal_button1_mode()); } - // .NSPanelSettings.NSPanelButtonMode button2_mode = 28; + // .NSPanelSettings.NSPanelButtonFallbackMode button1_fallback = 31; + if (this->_internal_button1_fallback() != 0) { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_button1_fallback()); + } + + // .NSPanelSettings.NSPanelButtonMode button2_mode = 32; if (this->_internal_button2_mode() != 0) { total_size += 2 + ::_pbi::WireFormatLite::EnumSize(this->_internal_button2_mode()); } - if (cached_has_bits & 0x00000060u) { - // optional int32 button1_detached_light_id = 33; - if (cached_has_bits & 0x00000020u) { - total_size += 2 + ::_pbi::WireFormatLite::Int32Size( - this->_internal_button1_detached_light_id()); - } + // .NSPanelSettings.NSPanelButtonFallbackMode button2_fallback = 33; + if (this->_internal_button2_fallback() != 0) { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_button2_fallback()); + } - // optional int32 button2_detached_light_id = 34; - if (cached_has_bits & 0x00000040u) { - total_size += 2 + ::_pbi::WireFormatLite::Int32Size( - this->_internal_button2_detached_light_id()); - } + // .NSPanelSettings.NSPanelButtonMode button1_long_mode = 34; + if (this->_internal_button1_long_mode() != 0) { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_button1_long_mode()); + } + + // .NSPanelSettings.NSPanelButtonFallbackMode button1_long_fallback = 35; + if (this->_internal_button1_long_fallback() != 0) { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_button1_long_fallback()); + } + + // .NSPanelSettings.NSPanelButtonMode button2_long_mode = 36; + if (this->_internal_button2_long_mode() != 0) { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_button2_long_mode()); + } + // .NSPanelSettings.NSPanelButtonFallbackMode button2_long_fallback = 37; + if (this->_internal_button2_long_fallback() != 0) { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_button2_long_fallback()); } + + // optional int32 button1_detached_light_id = 42; + if (cached_has_bits & 0x00000200u) { + total_size += 2 + ::_pbi::WireFormatLite::Int32Size( + this->_internal_button1_detached_light_id()); + } + // bool relay2_default_mode = 25; if (this->_internal_relay2_default_mode() != 0) { total_size += 3; } - // bool denied = 45; + // bool denied = 50; if (this->_internal_denied() != 0) { total_size += 3; } - // bool accepted = 46; + // bool accepted = 51; if (this->_internal_accepted() != 0) { total_size += 3; } - // .NSPanelSettings.RelayRegisterType relay1_register_type = 50; + if (cached_has_bits & 0x00001c00u) { + // optional int32 button2_detached_light_id = 43; + if (cached_has_bits & 0x00000400u) { + total_size += 2 + ::_pbi::WireFormatLite::Int32Size( + this->_internal_button2_detached_light_id()); + } + + // optional int32 button1_long_detached_light_id = 48; + if (cached_has_bits & 0x00000800u) { + total_size += 2 + ::_pbi::WireFormatLite::Int32Size( + this->_internal_button1_long_detached_light_id()); + } + + // optional int32 button2_long_detached_light_id = 49; + if (cached_has_bits & 0x00001000u) { + total_size += 2 + ::_pbi::WireFormatLite::Int32Size( + this->_internal_button2_long_detached_light_id()); + } + + } + // .NSPanelSettings.RelayRegisterType relay1_register_type = 55; if (this->_internal_relay1_register_type() != 0) { total_size += 2 + ::_pbi::WireFormatLite::EnumSize(this->_internal_relay1_register_type()); } - // .NSPanelSettings.RelayRegisterType relay2_register_type = 51; + // .NSPanelSettings.RelayRegisterType relay2_register_type = 56; if (this->_internal_relay2_register_type() != 0) { total_size += 2 + ::_pbi::WireFormatLite::EnumSize(this->_internal_relay2_register_type()); } - // int32 default_room = 52; + // int32 default_room = 57; if (this->_internal_default_room() != 0) { total_size += 2 + ::_pbi::WireFormatLite::Int32Size( this->_internal_default_room()); @@ -1342,7 +1659,7 @@ void NSPanelSettings::MergeImpl(::google::protobuf::MessageLite& to_msg, const : _this->_internal_set_name(from._internal_name()); } cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x000000ffu) { if (cached_has_bits & 0x00000001u) { _this->_internal_set_button1_mqtt_topic(from._internal_button1_mqtt_topic()); } @@ -1355,11 +1672,23 @@ void NSPanelSettings::MergeImpl(::google::protobuf::MessageLite& to_msg, const : if (cached_has_bits & 0x00000008u) { _this->_internal_set_button2_mqtt_payload(from._internal_button2_mqtt_payload()); } + if (cached_has_bits & 0x00000010u) { + _this->_internal_set_button1_long_mqtt_topic(from._internal_button1_long_mqtt_topic()); + } + if (cached_has_bits & 0x00000020u) { + _this->_internal_set_button2_long_mqtt_topic(from._internal_button2_long_mqtt_topic()); + } + if (cached_has_bits & 0x00000040u) { + _this->_internal_set_button1_long_mqtt_payload(from._internal_button1_long_mqtt_payload()); + } + if (cached_has_bits & 0x00000080u) { + _this->_internal_set_button2_long_mqtt_payload(from._internal_button2_long_mqtt_payload()); + } } if (!from._internal_ip_address().empty()) { _this->_internal_set_ip_address(from._internal_ip_address()); } - if (cached_has_bits & 0x00000010u) { + if (cached_has_bits & 0x00000100u) { _this->_impl_.id_ = from._impl_.id_; } if (from._internal_home() != 0) { @@ -1419,16 +1748,29 @@ void NSPanelSettings::MergeImpl(::google::protobuf::MessageLite& to_msg, const : if (from._internal_button1_mode() != 0) { _this->_impl_.button1_mode_ = from._impl_.button1_mode_; } + if (from._internal_button1_fallback() != 0) { + _this->_impl_.button1_fallback_ = from._impl_.button1_fallback_; + } if (from._internal_button2_mode() != 0) { _this->_impl_.button2_mode_ = from._impl_.button2_mode_; } - if (cached_has_bits & 0x00000060u) { - if (cached_has_bits & 0x00000020u) { - _this->_impl_.button1_detached_light_id_ = from._impl_.button1_detached_light_id_; - } - if (cached_has_bits & 0x00000040u) { - _this->_impl_.button2_detached_light_id_ = from._impl_.button2_detached_light_id_; - } + if (from._internal_button2_fallback() != 0) { + _this->_impl_.button2_fallback_ = from._impl_.button2_fallback_; + } + if (from._internal_button1_long_mode() != 0) { + _this->_impl_.button1_long_mode_ = from._impl_.button1_long_mode_; + } + if (from._internal_button1_long_fallback() != 0) { + _this->_impl_.button1_long_fallback_ = from._impl_.button1_long_fallback_; + } + if (from._internal_button2_long_mode() != 0) { + _this->_impl_.button2_long_mode_ = from._impl_.button2_long_mode_; + } + if (from._internal_button2_long_fallback() != 0) { + _this->_impl_.button2_long_fallback_ = from._impl_.button2_long_fallback_; + } + if (cached_has_bits & 0x00000200u) { + _this->_impl_.button1_detached_light_id_ = from._impl_.button1_detached_light_id_; } if (from._internal_relay2_default_mode() != 0) { _this->_impl_.relay2_default_mode_ = from._impl_.relay2_default_mode_; @@ -1439,6 +1781,17 @@ void NSPanelSettings::MergeImpl(::google::protobuf::MessageLite& to_msg, const : if (from._internal_accepted() != 0) { _this->_impl_.accepted_ = from._impl_.accepted_; } + if (cached_has_bits & 0x00001c00u) { + if (cached_has_bits & 0x00000400u) { + _this->_impl_.button2_detached_light_id_ = from._impl_.button2_detached_light_id_; + } + if (cached_has_bits & 0x00000800u) { + _this->_impl_.button1_long_detached_light_id_ = from._impl_.button1_long_detached_light_id_; + } + if (cached_has_bits & 0x00001000u) { + _this->_impl_.button2_long_detached_light_id_ = from._impl_.button2_long_detached_light_id_; + } + } if (from._internal_relay1_register_type() != 0) { _this->_impl_.relay1_register_type_ = from._impl_.relay1_register_type_; } @@ -1474,6 +1827,10 @@ void NSPanelSettings::InternalSwap(NSPanelSettings* PROTOBUF_RESTRICT other) { ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.button2_mqtt_topic_, &other->_impl_.button2_mqtt_topic_, arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.button1_mqtt_payload_, &other->_impl_.button1_mqtt_payload_, arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.button2_mqtt_payload_, &other->_impl_.button2_mqtt_payload_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.button1_long_mqtt_topic_, &other->_impl_.button1_long_mqtt_topic_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.button2_long_mqtt_topic_, &other->_impl_.button2_long_mqtt_topic_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.button1_long_mqtt_payload_, &other->_impl_.button1_long_mqtt_payload_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.button2_long_mqtt_payload_, &other->_impl_.button2_long_mqtt_payload_, arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.ip_address_, &other->_impl_.ip_address_, arena); ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(NSPanelSettings, _impl_.default_room_) diff --git a/docker/MQTTManager/include/protobuf/protobuf_mqttmanager.pb.h b/docker/MQTTManager/include/protobuf/protobuf_mqttmanager.pb.h index 3d58bde7..1ddb7eda 100644 --- a/docker/MQTTManager/include/protobuf/protobuf_mqttmanager.pb.h +++ b/docker/MQTTManager/include/protobuf/protobuf_mqttmanager.pb.h @@ -167,6 +167,40 @@ inline bool NSPanelSettings_NSPanelButtonMode_Parse(absl::string_view name, NSPa return ::google::protobuf::internal::ParseNamedEnum( NSPanelSettings_NSPanelButtonMode_descriptor(), name, value); } +enum NSPanelSettings_NSPanelButtonFallbackMode : int { + NSPanelSettings_NSPanelButtonFallbackMode_DISABLED = 0, + NSPanelSettings_NSPanelButtonFallbackMode_TOGGLE_RELAY1 = 1, + NSPanelSettings_NSPanelButtonFallbackMode_TOGLLE_RELAY2 = 2, + NSPanelSettings_NSPanelButtonFallbackMode_NSPanelSettings_NSPanelButtonFallbackMode_INT_MIN_SENTINEL_DO_NOT_USE_ = + std::numeric_limits<::int32_t>::min(), + NSPanelSettings_NSPanelButtonFallbackMode_NSPanelSettings_NSPanelButtonFallbackMode_INT_MAX_SENTINEL_DO_NOT_USE_ = + std::numeric_limits<::int32_t>::max(), +}; + +bool NSPanelSettings_NSPanelButtonFallbackMode_IsValid(int value); +extern const uint32_t NSPanelSettings_NSPanelButtonFallbackMode_internal_data_[]; +constexpr NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings_NSPanelButtonFallbackMode_NSPanelButtonFallbackMode_MIN = static_cast(0); +constexpr NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings_NSPanelButtonFallbackMode_NSPanelButtonFallbackMode_MAX = static_cast(2); +constexpr int NSPanelSettings_NSPanelButtonFallbackMode_NSPanelButtonFallbackMode_ARRAYSIZE = 2 + 1; +const ::google::protobuf::EnumDescriptor* +NSPanelSettings_NSPanelButtonFallbackMode_descriptor(); +template +const std::string& NSPanelSettings_NSPanelButtonFallbackMode_Name(T value) { + static_assert(std::is_same::value || + std::is_integral::value, + "Incorrect type passed to NSPanelButtonFallbackMode_Name()."); + return NSPanelSettings_NSPanelButtonFallbackMode_Name(static_cast(value)); +} +template <> +inline const std::string& NSPanelSettings_NSPanelButtonFallbackMode_Name(NSPanelSettings_NSPanelButtonFallbackMode value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool NSPanelSettings_NSPanelButtonFallbackMode_Parse(absl::string_view name, NSPanelSettings_NSPanelButtonFallbackMode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + NSPanelSettings_NSPanelButtonFallbackMode_descriptor(), name, value); +} enum NSPanelSettings_RelayRegisterType : int { NSPanelSettings_RelayRegisterType_SWITCH = 0, NSPanelSettings_RelayRegisterType_LIGHT = 1, @@ -390,6 +424,26 @@ class NSPanelSettings final : public ::google::protobuf::Message static inline bool NSPanelButtonMode_Parse(absl::string_view name, NSPanelButtonMode* value) { return NSPanelSettings_NSPanelButtonMode_Parse(name, value); } + using NSPanelButtonFallbackMode = NSPanelSettings_NSPanelButtonFallbackMode; + static constexpr NSPanelButtonFallbackMode DISABLED = NSPanelSettings_NSPanelButtonFallbackMode_DISABLED; + static constexpr NSPanelButtonFallbackMode TOGGLE_RELAY1 = NSPanelSettings_NSPanelButtonFallbackMode_TOGGLE_RELAY1; + static constexpr NSPanelButtonFallbackMode TOGLLE_RELAY2 = NSPanelSettings_NSPanelButtonFallbackMode_TOGLLE_RELAY2; + static inline bool NSPanelButtonFallbackMode_IsValid(int value) { + return NSPanelSettings_NSPanelButtonFallbackMode_IsValid(value); + } + static constexpr NSPanelButtonFallbackMode NSPanelButtonFallbackMode_MIN = NSPanelSettings_NSPanelButtonFallbackMode_NSPanelButtonFallbackMode_MIN; + static constexpr NSPanelButtonFallbackMode NSPanelButtonFallbackMode_MAX = NSPanelSettings_NSPanelButtonFallbackMode_NSPanelButtonFallbackMode_MAX; + static constexpr int NSPanelButtonFallbackMode_ARRAYSIZE = NSPanelSettings_NSPanelButtonFallbackMode_NSPanelButtonFallbackMode_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* NSPanelButtonFallbackMode_descriptor() { + return NSPanelSettings_NSPanelButtonFallbackMode_descriptor(); + } + template + static inline const std::string& NSPanelButtonFallbackMode_Name(T value) { + return NSPanelSettings_NSPanelButtonFallbackMode_Name(value); + } + static inline bool NSPanelButtonFallbackMode_Parse(absl::string_view name, NSPanelButtonFallbackMode* value) { + return NSPanelSettings_NSPanelButtonFallbackMode_Parse(name, value); + } using RelayRegisterType = NSPanelSettings_RelayRegisterType; static constexpr RelayRegisterType SWITCH = NSPanelSettings_RelayRegisterType_SWITCH; static constexpr RelayRegisterType LIGHT = NSPanelSettings_RelayRegisterType_LIGHT; @@ -412,15 +466,19 @@ class NSPanelSettings final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kRoomsFieldNumber = 47, - kScenesFieldNumber = 48, + kRoomsFieldNumber = 52, + kScenesFieldNumber = 53, kMacAddressFieldNumber = 2, kNameFieldNumber = 3, - kButton1MqttTopicFieldNumber = 29, - kButton2MqttTopicFieldNumber = 30, - kButton1MqttPayloadFieldNumber = 31, - kButton2MqttPayloadFieldNumber = 32, - kIpAddressFieldNumber = 49, + kButton1MqttTopicFieldNumber = 38, + kButton2MqttTopicFieldNumber = 39, + kButton1MqttPayloadFieldNumber = 40, + kButton2MqttPayloadFieldNumber = 41, + kButton1LongMqttTopicFieldNumber = 44, + kButton2LongMqttTopicFieldNumber = 45, + kButton1LongMqttPayloadFieldNumber = 46, + kButton2LongMqttPayloadFieldNumber = 47, + kIpAddressFieldNumber = 54, kIdFieldNumber = 1, kHomeFieldNumber = 4, kDefaultPageFieldNumber = 5, @@ -440,18 +498,26 @@ class NSPanelSettings final : public ::google::protobuf::Message kReverseRelaysFieldNumber = 23, kRelay1DefaultModeFieldNumber = 24, kTemperatureCalibrationFieldNumber = 26, - kButton1ModeFieldNumber = 27, - kButton2ModeFieldNumber = 28, - kButton1DetachedLightIdFieldNumber = 33, - kButton2DetachedLightIdFieldNumber = 34, + kButton1ModeFieldNumber = 30, + kButton1FallbackFieldNumber = 31, + kButton2ModeFieldNumber = 32, + kButton2FallbackFieldNumber = 33, + kButton1LongModeFieldNumber = 34, + kButton1LongFallbackFieldNumber = 35, + kButton2LongModeFieldNumber = 36, + kButton2LongFallbackFieldNumber = 37, + kButton1DetachedLightIdFieldNumber = 42, kRelay2DefaultModeFieldNumber = 25, - kDeniedFieldNumber = 45, - kAcceptedFieldNumber = 46, - kRelay1RegisterTypeFieldNumber = 50, - kRelay2RegisterTypeFieldNumber = 51, - kDefaultRoomFieldNumber = 52, + kDeniedFieldNumber = 50, + kAcceptedFieldNumber = 51, + kButton2DetachedLightIdFieldNumber = 43, + kButton1LongDetachedLightIdFieldNumber = 48, + kButton2LongDetachedLightIdFieldNumber = 49, + kRelay1RegisterTypeFieldNumber = 55, + kRelay2RegisterTypeFieldNumber = 56, + kDefaultRoomFieldNumber = 57, }; - // repeated int32 rooms = 47; + // repeated int32 rooms = 52; int rooms_size() const; private: int _internal_rooms_size() const; @@ -469,7 +535,7 @@ class NSPanelSettings final : public ::google::protobuf::Message ::google::protobuf::RepeatedField<::int32_t>* _internal_mutable_rooms(); public: - // repeated int32 scenes = 48; + // repeated int32 scenes = 53; int scenes_size() const; private: int _internal_scenes_size() const; @@ -519,7 +585,7 @@ class NSPanelSettings final : public ::google::protobuf::Message std::string* _internal_mutable_name(); public: - // optional string button1_mqtt_topic = 29; + // optional string button1_mqtt_topic = 38; bool has_button1_mqtt_topic() const; void clear_button1_mqtt_topic() ; const std::string& button1_mqtt_topic() const; @@ -536,7 +602,7 @@ class NSPanelSettings final : public ::google::protobuf::Message std::string* _internal_mutable_button1_mqtt_topic(); public: - // optional string button2_mqtt_topic = 30; + // optional string button2_mqtt_topic = 39; bool has_button2_mqtt_topic() const; void clear_button2_mqtt_topic() ; const std::string& button2_mqtt_topic() const; @@ -553,7 +619,7 @@ class NSPanelSettings final : public ::google::protobuf::Message std::string* _internal_mutable_button2_mqtt_topic(); public: - // optional string button1_mqtt_payload = 31; + // optional string button1_mqtt_payload = 40; bool has_button1_mqtt_payload() const; void clear_button1_mqtt_payload() ; const std::string& button1_mqtt_payload() const; @@ -570,7 +636,7 @@ class NSPanelSettings final : public ::google::protobuf::Message std::string* _internal_mutable_button1_mqtt_payload(); public: - // optional string button2_mqtt_payload = 32; + // optional string button2_mqtt_payload = 41; bool has_button2_mqtt_payload() const; void clear_button2_mqtt_payload() ; const std::string& button2_mqtt_payload() const; @@ -587,7 +653,75 @@ class NSPanelSettings final : public ::google::protobuf::Message std::string* _internal_mutable_button2_mqtt_payload(); public: - // string ip_address = 49; + // optional string button1_long_mqtt_topic = 44; + bool has_button1_long_mqtt_topic() const; + void clear_button1_long_mqtt_topic() ; + const std::string& button1_long_mqtt_topic() const; + template + void set_button1_long_mqtt_topic(Arg_&& arg, Args_... args); + std::string* mutable_button1_long_mqtt_topic(); + PROTOBUF_NODISCARD std::string* release_button1_long_mqtt_topic(); + void set_allocated_button1_long_mqtt_topic(std::string* value); + + private: + const std::string& _internal_button1_long_mqtt_topic() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_button1_long_mqtt_topic( + const std::string& value); + std::string* _internal_mutable_button1_long_mqtt_topic(); + + public: + // optional string button2_long_mqtt_topic = 45; + bool has_button2_long_mqtt_topic() const; + void clear_button2_long_mqtt_topic() ; + const std::string& button2_long_mqtt_topic() const; + template + void set_button2_long_mqtt_topic(Arg_&& arg, Args_... args); + std::string* mutable_button2_long_mqtt_topic(); + PROTOBUF_NODISCARD std::string* release_button2_long_mqtt_topic(); + void set_allocated_button2_long_mqtt_topic(std::string* value); + + private: + const std::string& _internal_button2_long_mqtt_topic() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_button2_long_mqtt_topic( + const std::string& value); + std::string* _internal_mutable_button2_long_mqtt_topic(); + + public: + // optional string button1_long_mqtt_payload = 46; + bool has_button1_long_mqtt_payload() const; + void clear_button1_long_mqtt_payload() ; + const std::string& button1_long_mqtt_payload() const; + template + void set_button1_long_mqtt_payload(Arg_&& arg, Args_... args); + std::string* mutable_button1_long_mqtt_payload(); + PROTOBUF_NODISCARD std::string* release_button1_long_mqtt_payload(); + void set_allocated_button1_long_mqtt_payload(std::string* value); + + private: + const std::string& _internal_button1_long_mqtt_payload() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_button1_long_mqtt_payload( + const std::string& value); + std::string* _internal_mutable_button1_long_mqtt_payload(); + + public: + // optional string button2_long_mqtt_payload = 47; + bool has_button2_long_mqtt_payload() const; + void clear_button2_long_mqtt_payload() ; + const std::string& button2_long_mqtt_payload() const; + template + void set_button2_long_mqtt_payload(Arg_&& arg, Args_... args); + std::string* mutable_button2_long_mqtt_payload(); + PROTOBUF_NODISCARD std::string* release_button2_long_mqtt_payload(); + void set_allocated_button2_long_mqtt_payload(std::string* value); + + private: + const std::string& _internal_button2_long_mqtt_payload() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_button2_long_mqtt_payload( + const std::string& value); + std::string* _internal_mutable_button2_long_mqtt_payload(); + + public: + // string ip_address = 54; void clear_ip_address() ; const std::string& ip_address() const; template @@ -794,7 +928,7 @@ class NSPanelSettings final : public ::google::protobuf::Message void _internal_set_temperature_calibration(::int32_t value); public: - // .NSPanelSettings.NSPanelButtonMode button1_mode = 27; + // .NSPanelSettings.NSPanelButtonMode button1_mode = 30; void clear_button1_mode() ; ::NSPanelSettings_NSPanelButtonMode button1_mode() const; void set_button1_mode(::NSPanelSettings_NSPanelButtonMode value); @@ -804,7 +938,17 @@ class NSPanelSettings final : public ::google::protobuf::Message void _internal_set_button1_mode(::NSPanelSettings_NSPanelButtonMode value); public: - // .NSPanelSettings.NSPanelButtonMode button2_mode = 28; + // .NSPanelSettings.NSPanelButtonFallbackMode button1_fallback = 31; + void clear_button1_fallback() ; + ::NSPanelSettings_NSPanelButtonFallbackMode button1_fallback() const; + void set_button1_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value); + + private: + ::NSPanelSettings_NSPanelButtonFallbackMode _internal_button1_fallback() const; + void _internal_set_button1_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value); + + public: + // .NSPanelSettings.NSPanelButtonMode button2_mode = 32; void clear_button2_mode() ; ::NSPanelSettings_NSPanelButtonMode button2_mode() const; void set_button2_mode(::NSPanelSettings_NSPanelButtonMode value); @@ -814,7 +958,57 @@ class NSPanelSettings final : public ::google::protobuf::Message void _internal_set_button2_mode(::NSPanelSettings_NSPanelButtonMode value); public: - // optional int32 button1_detached_light_id = 33; + // .NSPanelSettings.NSPanelButtonFallbackMode button2_fallback = 33; + void clear_button2_fallback() ; + ::NSPanelSettings_NSPanelButtonFallbackMode button2_fallback() const; + void set_button2_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value); + + private: + ::NSPanelSettings_NSPanelButtonFallbackMode _internal_button2_fallback() const; + void _internal_set_button2_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value); + + public: + // .NSPanelSettings.NSPanelButtonMode button1_long_mode = 34; + void clear_button1_long_mode() ; + ::NSPanelSettings_NSPanelButtonMode button1_long_mode() const; + void set_button1_long_mode(::NSPanelSettings_NSPanelButtonMode value); + + private: + ::NSPanelSettings_NSPanelButtonMode _internal_button1_long_mode() const; + void _internal_set_button1_long_mode(::NSPanelSettings_NSPanelButtonMode value); + + public: + // .NSPanelSettings.NSPanelButtonFallbackMode button1_long_fallback = 35; + void clear_button1_long_fallback() ; + ::NSPanelSettings_NSPanelButtonFallbackMode button1_long_fallback() const; + void set_button1_long_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value); + + private: + ::NSPanelSettings_NSPanelButtonFallbackMode _internal_button1_long_fallback() const; + void _internal_set_button1_long_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value); + + public: + // .NSPanelSettings.NSPanelButtonMode button2_long_mode = 36; + void clear_button2_long_mode() ; + ::NSPanelSettings_NSPanelButtonMode button2_long_mode() const; + void set_button2_long_mode(::NSPanelSettings_NSPanelButtonMode value); + + private: + ::NSPanelSettings_NSPanelButtonMode _internal_button2_long_mode() const; + void _internal_set_button2_long_mode(::NSPanelSettings_NSPanelButtonMode value); + + public: + // .NSPanelSettings.NSPanelButtonFallbackMode button2_long_fallback = 37; + void clear_button2_long_fallback() ; + ::NSPanelSettings_NSPanelButtonFallbackMode button2_long_fallback() const; + void set_button2_long_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value); + + private: + ::NSPanelSettings_NSPanelButtonFallbackMode _internal_button2_long_fallback() const; + void _internal_set_button2_long_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value); + + public: + // optional int32 button1_detached_light_id = 42; bool has_button1_detached_light_id() const; void clear_button1_detached_light_id() ; ::int32_t button1_detached_light_id() const; @@ -824,17 +1018,6 @@ class NSPanelSettings final : public ::google::protobuf::Message ::int32_t _internal_button1_detached_light_id() const; void _internal_set_button1_detached_light_id(::int32_t value); - public: - // optional int32 button2_detached_light_id = 34; - bool has_button2_detached_light_id() const; - void clear_button2_detached_light_id() ; - ::int32_t button2_detached_light_id() const; - void set_button2_detached_light_id(::int32_t value); - - private: - ::int32_t _internal_button2_detached_light_id() const; - void _internal_set_button2_detached_light_id(::int32_t value); - public: // bool relay2_default_mode = 25; void clear_relay2_default_mode() ; @@ -846,7 +1029,7 @@ class NSPanelSettings final : public ::google::protobuf::Message void _internal_set_relay2_default_mode(bool value); public: - // bool denied = 45; + // bool denied = 50; void clear_denied() ; bool denied() const; void set_denied(bool value); @@ -856,7 +1039,7 @@ class NSPanelSettings final : public ::google::protobuf::Message void _internal_set_denied(bool value); public: - // bool accepted = 46; + // bool accepted = 51; void clear_accepted() ; bool accepted() const; void set_accepted(bool value); @@ -866,7 +1049,40 @@ class NSPanelSettings final : public ::google::protobuf::Message void _internal_set_accepted(bool value); public: - // .NSPanelSettings.RelayRegisterType relay1_register_type = 50; + // optional int32 button2_detached_light_id = 43; + bool has_button2_detached_light_id() const; + void clear_button2_detached_light_id() ; + ::int32_t button2_detached_light_id() const; + void set_button2_detached_light_id(::int32_t value); + + private: + ::int32_t _internal_button2_detached_light_id() const; + void _internal_set_button2_detached_light_id(::int32_t value); + + public: + // optional int32 button1_long_detached_light_id = 48; + bool has_button1_long_detached_light_id() const; + void clear_button1_long_detached_light_id() ; + ::int32_t button1_long_detached_light_id() const; + void set_button1_long_detached_light_id(::int32_t value); + + private: + ::int32_t _internal_button1_long_detached_light_id() const; + void _internal_set_button1_long_detached_light_id(::int32_t value); + + public: + // optional int32 button2_long_detached_light_id = 49; + bool has_button2_long_detached_light_id() const; + void clear_button2_long_detached_light_id() ; + ::int32_t button2_long_detached_light_id() const; + void set_button2_long_detached_light_id(::int32_t value); + + private: + ::int32_t _internal_button2_long_detached_light_id() const; + void _internal_set_button2_long_detached_light_id(::int32_t value); + + public: + // .NSPanelSettings.RelayRegisterType relay1_register_type = 55; void clear_relay1_register_type() ; ::NSPanelSettings_RelayRegisterType relay1_register_type() const; void set_relay1_register_type(::NSPanelSettings_RelayRegisterType value); @@ -876,7 +1092,7 @@ class NSPanelSettings final : public ::google::protobuf::Message void _internal_set_relay1_register_type(::NSPanelSettings_RelayRegisterType value); public: - // .NSPanelSettings.RelayRegisterType relay2_register_type = 51; + // .NSPanelSettings.RelayRegisterType relay2_register_type = 56; void clear_relay2_register_type() ; ::NSPanelSettings_RelayRegisterType relay2_register_type() const; void set_relay2_register_type(::NSPanelSettings_RelayRegisterType value); @@ -886,7 +1102,7 @@ class NSPanelSettings final : public ::google::protobuf::Message void _internal_set_relay2_register_type(::NSPanelSettings_RelayRegisterType value); public: - // int32 default_room = 52; + // int32 default_room = 57; void clear_default_room() ; ::int32_t default_room() const; void set_default_room(::int32_t value); @@ -901,8 +1117,8 @@ class NSPanelSettings final : public ::google::protobuf::Message class _Internal; friend class ::google::protobuf::internal::TcParser; static const ::google::protobuf::internal::TcParseTable< - 5, 38, 0, - 157, 9> + 5, 50, 0, + 269, 9> _table_; static constexpr const void* _raw_default_instance_ = @@ -934,6 +1150,10 @@ class NSPanelSettings final : public ::google::protobuf::Message ::google::protobuf::internal::ArenaStringPtr button2_mqtt_topic_; ::google::protobuf::internal::ArenaStringPtr button1_mqtt_payload_; ::google::protobuf::internal::ArenaStringPtr button2_mqtt_payload_; + ::google::protobuf::internal::ArenaStringPtr button1_long_mqtt_topic_; + ::google::protobuf::internal::ArenaStringPtr button2_long_mqtt_topic_; + ::google::protobuf::internal::ArenaStringPtr button1_long_mqtt_payload_; + ::google::protobuf::internal::ArenaStringPtr button2_long_mqtt_payload_; ::google::protobuf::internal::ArenaStringPtr ip_address_; ::int32_t id_; ::int32_t home_; @@ -955,12 +1175,20 @@ class NSPanelSettings final : public ::google::protobuf::Message bool relay1_default_mode_; ::int32_t temperature_calibration_; int button1_mode_; + int button1_fallback_; int button2_mode_; + int button2_fallback_; + int button1_long_mode_; + int button1_long_fallback_; + int button2_long_mode_; + int button2_long_fallback_; ::int32_t button1_detached_light_id_; - ::int32_t button2_detached_light_id_; bool relay2_default_mode_; bool denied_; bool accepted_; + ::int32_t button2_detached_light_id_; + ::int32_t button1_long_detached_light_id_; + ::int32_t button2_long_detached_light_id_; int relay1_register_type_; int relay2_register_type_; ::int32_t default_room_; @@ -1166,13 +1394,13 @@ class MultipleNSPanelsSettings final : public ::google::protobuf::Message // optional int32 id = 1; inline bool NSPanelSettings::has_id() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; return value; } inline void NSPanelSettings::clear_id() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.id_ = 0; - _impl_._has_bits_[0] &= ~0x00000010u; + _impl_._has_bits_[0] &= ~0x00000100u; } inline ::int32_t NSPanelSettings::id() const { // @@protoc_insertion_point(field_get:NSPanelSettings.id) @@ -1180,7 +1408,7 @@ inline ::int32_t NSPanelSettings::id() const { } inline void NSPanelSettings::set_id(::int32_t value) { _internal_set_id(value); - _impl_._has_bits_[0] |= 0x00000010u; + _impl_._has_bits_[0] |= 0x00000100u; // @@protoc_insertion_point(field_set:NSPanelSettings.id) } inline ::int32_t NSPanelSettings::_internal_id() const { @@ -1710,7 +1938,7 @@ inline void NSPanelSettings::_internal_set_temperature_calibration(::int32_t val _impl_.temperature_calibration_ = value; } -// .NSPanelSettings.NSPanelButtonMode button1_mode = 27; +// .NSPanelSettings.NSPanelButtonMode button1_mode = 30; inline void NSPanelSettings::clear_button1_mode() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.button1_mode_ = 0; @@ -1732,7 +1960,29 @@ inline void NSPanelSettings::_internal_set_button1_mode(::NSPanelSettings_NSPane _impl_.button1_mode_ = value; } -// .NSPanelSettings.NSPanelButtonMode button2_mode = 28; +// .NSPanelSettings.NSPanelButtonFallbackMode button1_fallback = 31; +inline void NSPanelSettings::clear_button1_fallback() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_fallback_ = 0; +} +inline ::NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings::button1_fallback() const { + // @@protoc_insertion_point(field_get:NSPanelSettings.button1_fallback) + return _internal_button1_fallback(); +} +inline void NSPanelSettings::set_button1_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value) { + _internal_set_button1_fallback(value); + // @@protoc_insertion_point(field_set:NSPanelSettings.button1_fallback) +} +inline ::NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings::_internal_button1_fallback() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::NSPanelSettings_NSPanelButtonFallbackMode>(_impl_.button1_fallback_); +} +inline void NSPanelSettings::_internal_set_button1_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_fallback_ = value; +} + +// .NSPanelSettings.NSPanelButtonMode button2_mode = 32; inline void NSPanelSettings::clear_button2_mode() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.button2_mode_ = 0; @@ -1754,7 +2004,117 @@ inline void NSPanelSettings::_internal_set_button2_mode(::NSPanelSettings_NSPane _impl_.button2_mode_ = value; } -// optional string button1_mqtt_topic = 29; +// .NSPanelSettings.NSPanelButtonFallbackMode button2_fallback = 33; +inline void NSPanelSettings::clear_button2_fallback() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_fallback_ = 0; +} +inline ::NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings::button2_fallback() const { + // @@protoc_insertion_point(field_get:NSPanelSettings.button2_fallback) + return _internal_button2_fallback(); +} +inline void NSPanelSettings::set_button2_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value) { + _internal_set_button2_fallback(value); + // @@protoc_insertion_point(field_set:NSPanelSettings.button2_fallback) +} +inline ::NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings::_internal_button2_fallback() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::NSPanelSettings_NSPanelButtonFallbackMode>(_impl_.button2_fallback_); +} +inline void NSPanelSettings::_internal_set_button2_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_fallback_ = value; +} + +// .NSPanelSettings.NSPanelButtonMode button1_long_mode = 34; +inline void NSPanelSettings::clear_button1_long_mode() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_long_mode_ = 0; +} +inline ::NSPanelSettings_NSPanelButtonMode NSPanelSettings::button1_long_mode() const { + // @@protoc_insertion_point(field_get:NSPanelSettings.button1_long_mode) + return _internal_button1_long_mode(); +} +inline void NSPanelSettings::set_button1_long_mode(::NSPanelSettings_NSPanelButtonMode value) { + _internal_set_button1_long_mode(value); + // @@protoc_insertion_point(field_set:NSPanelSettings.button1_long_mode) +} +inline ::NSPanelSettings_NSPanelButtonMode NSPanelSettings::_internal_button1_long_mode() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::NSPanelSettings_NSPanelButtonMode>(_impl_.button1_long_mode_); +} +inline void NSPanelSettings::_internal_set_button1_long_mode(::NSPanelSettings_NSPanelButtonMode value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_long_mode_ = value; +} + +// .NSPanelSettings.NSPanelButtonFallbackMode button1_long_fallback = 35; +inline void NSPanelSettings::clear_button1_long_fallback() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_long_fallback_ = 0; +} +inline ::NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings::button1_long_fallback() const { + // @@protoc_insertion_point(field_get:NSPanelSettings.button1_long_fallback) + return _internal_button1_long_fallback(); +} +inline void NSPanelSettings::set_button1_long_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value) { + _internal_set_button1_long_fallback(value); + // @@protoc_insertion_point(field_set:NSPanelSettings.button1_long_fallback) +} +inline ::NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings::_internal_button1_long_fallback() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::NSPanelSettings_NSPanelButtonFallbackMode>(_impl_.button1_long_fallback_); +} +inline void NSPanelSettings::_internal_set_button1_long_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_long_fallback_ = value; +} + +// .NSPanelSettings.NSPanelButtonMode button2_long_mode = 36; +inline void NSPanelSettings::clear_button2_long_mode() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_long_mode_ = 0; +} +inline ::NSPanelSettings_NSPanelButtonMode NSPanelSettings::button2_long_mode() const { + // @@protoc_insertion_point(field_get:NSPanelSettings.button2_long_mode) + return _internal_button2_long_mode(); +} +inline void NSPanelSettings::set_button2_long_mode(::NSPanelSettings_NSPanelButtonMode value) { + _internal_set_button2_long_mode(value); + // @@protoc_insertion_point(field_set:NSPanelSettings.button2_long_mode) +} +inline ::NSPanelSettings_NSPanelButtonMode NSPanelSettings::_internal_button2_long_mode() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::NSPanelSettings_NSPanelButtonMode>(_impl_.button2_long_mode_); +} +inline void NSPanelSettings::_internal_set_button2_long_mode(::NSPanelSettings_NSPanelButtonMode value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_long_mode_ = value; +} + +// .NSPanelSettings.NSPanelButtonFallbackMode button2_long_fallback = 37; +inline void NSPanelSettings::clear_button2_long_fallback() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_long_fallback_ = 0; +} +inline ::NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings::button2_long_fallback() const { + // @@protoc_insertion_point(field_get:NSPanelSettings.button2_long_fallback) + return _internal_button2_long_fallback(); +} +inline void NSPanelSettings::set_button2_long_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value) { + _internal_set_button2_long_fallback(value); + // @@protoc_insertion_point(field_set:NSPanelSettings.button2_long_fallback) +} +inline ::NSPanelSettings_NSPanelButtonFallbackMode NSPanelSettings::_internal_button2_long_fallback() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::NSPanelSettings_NSPanelButtonFallbackMode>(_impl_.button2_long_fallback_); +} +inline void NSPanelSettings::_internal_set_button2_long_fallback(::NSPanelSettings_NSPanelButtonFallbackMode value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_long_fallback_ = value; +} + +// optional string button1_mqtt_topic = 38; inline bool NSPanelSettings::has_button1_mqtt_topic() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -1825,7 +2185,7 @@ inline void NSPanelSettings::set_allocated_button1_mqtt_topic(std::string* value // @@protoc_insertion_point(field_set_allocated:NSPanelSettings.button1_mqtt_topic) } -// optional string button2_mqtt_topic = 30; +// optional string button2_mqtt_topic = 39; inline bool NSPanelSettings::has_button2_mqtt_topic() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -1896,7 +2256,7 @@ inline void NSPanelSettings::set_allocated_button2_mqtt_topic(std::string* value // @@protoc_insertion_point(field_set_allocated:NSPanelSettings.button2_mqtt_topic) } -// optional string button1_mqtt_payload = 31; +// optional string button1_mqtt_payload = 40; inline bool NSPanelSettings::has_button1_mqtt_payload() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -1967,7 +2327,7 @@ inline void NSPanelSettings::set_allocated_button1_mqtt_payload(std::string* val // @@protoc_insertion_point(field_set_allocated:NSPanelSettings.button1_mqtt_payload) } -// optional string button2_mqtt_payload = 32; +// optional string button2_mqtt_payload = 41; inline bool NSPanelSettings::has_button2_mqtt_payload() const { bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; @@ -2038,15 +2398,15 @@ inline void NSPanelSettings::set_allocated_button2_mqtt_payload(std::string* val // @@protoc_insertion_point(field_set_allocated:NSPanelSettings.button2_mqtt_payload) } -// optional int32 button1_detached_light_id = 33; +// optional int32 button1_detached_light_id = 42; inline bool NSPanelSettings::has_button1_detached_light_id() const { - bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; return value; } inline void NSPanelSettings::clear_button1_detached_light_id() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.button1_detached_light_id_ = 0; - _impl_._has_bits_[0] &= ~0x00000020u; + _impl_._has_bits_[0] &= ~0x00000200u; } inline ::int32_t NSPanelSettings::button1_detached_light_id() const { // @@protoc_insertion_point(field_get:NSPanelSettings.button1_detached_light_id) @@ -2054,7 +2414,7 @@ inline ::int32_t NSPanelSettings::button1_detached_light_id() const { } inline void NSPanelSettings::set_button1_detached_light_id(::int32_t value) { _internal_set_button1_detached_light_id(value); - _impl_._has_bits_[0] |= 0x00000020u; + _impl_._has_bits_[0] |= 0x00000200u; // @@protoc_insertion_point(field_set:NSPanelSettings.button1_detached_light_id) } inline ::int32_t NSPanelSettings::_internal_button1_detached_light_id() const { @@ -2066,15 +2426,15 @@ inline void NSPanelSettings::_internal_set_button1_detached_light_id(::int32_t v _impl_.button1_detached_light_id_ = value; } -// optional int32 button2_detached_light_id = 34; +// optional int32 button2_detached_light_id = 43; inline bool NSPanelSettings::has_button2_detached_light_id() const { - bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; return value; } inline void NSPanelSettings::clear_button2_detached_light_id() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.button2_detached_light_id_ = 0; - _impl_._has_bits_[0] &= ~0x00000040u; + _impl_._has_bits_[0] &= ~0x00000400u; } inline ::int32_t NSPanelSettings::button2_detached_light_id() const { // @@protoc_insertion_point(field_get:NSPanelSettings.button2_detached_light_id) @@ -2082,7 +2442,7 @@ inline ::int32_t NSPanelSettings::button2_detached_light_id() const { } inline void NSPanelSettings::set_button2_detached_light_id(::int32_t value) { _internal_set_button2_detached_light_id(value); - _impl_._has_bits_[0] |= 0x00000040u; + _impl_._has_bits_[0] |= 0x00000400u; // @@protoc_insertion_point(field_set:NSPanelSettings.button2_detached_light_id) } inline ::int32_t NSPanelSettings::_internal_button2_detached_light_id() const { @@ -2094,7 +2454,347 @@ inline void NSPanelSettings::_internal_set_button2_detached_light_id(::int32_t v _impl_.button2_detached_light_id_ = value; } -// bool denied = 45; +// optional string button1_long_mqtt_topic = 44; +inline bool NSPanelSettings::has_button1_long_mqtt_topic() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + return value; +} +inline void NSPanelSettings::clear_button1_long_mqtt_topic() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_long_mqtt_topic_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000010u; +} +inline const std::string& NSPanelSettings::button1_long_mqtt_topic() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:NSPanelSettings.button1_long_mqtt_topic) + return _internal_button1_long_mqtt_topic(); +} +template +inline PROTOBUF_ALWAYS_INLINE void NSPanelSettings::set_button1_long_mqtt_topic(Arg_&& arg, + Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.button1_long_mqtt_topic_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:NSPanelSettings.button1_long_mqtt_topic) +} +inline std::string* NSPanelSettings::mutable_button1_long_mqtt_topic() ABSL_ATTRIBUTE_LIFETIME_BOUND { + std::string* _s = _internal_mutable_button1_long_mqtt_topic(); + // @@protoc_insertion_point(field_mutable:NSPanelSettings.button1_long_mqtt_topic) + return _s; +} +inline const std::string& NSPanelSettings::_internal_button1_long_mqtt_topic() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.button1_long_mqtt_topic_.Get(); +} +inline void NSPanelSettings::_internal_set_button1_long_mqtt_topic(const std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.button1_long_mqtt_topic_.Set(value, GetArena()); +} +inline std::string* NSPanelSettings::_internal_mutable_button1_long_mqtt_topic() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000010u; + return _impl_.button1_long_mqtt_topic_.Mutable( GetArena()); +} +inline std::string* NSPanelSettings::release_button1_long_mqtt_topic() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:NSPanelSettings.button1_long_mqtt_topic) + if ((_impl_._has_bits_[0] & 0x00000010u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000010u; + auto* released = _impl_.button1_long_mqtt_topic_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.button1_long_mqtt_topic_.Set("", GetArena()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; +} +inline void NSPanelSettings::set_allocated_button1_long_mqtt_topic(std::string* value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000010u; + } else { + _impl_._has_bits_[0] &= ~0x00000010u; + } + _impl_.button1_long_mqtt_topic_.SetAllocated(value, GetArena()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.button1_long_mqtt_topic_.IsDefault()) { + _impl_.button1_long_mqtt_topic_.Set("", GetArena()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:NSPanelSettings.button1_long_mqtt_topic) +} + +// optional string button2_long_mqtt_topic = 45; +inline bool NSPanelSettings::has_button2_long_mqtt_topic() const { + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; + return value; +} +inline void NSPanelSettings::clear_button2_long_mqtt_topic() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_long_mqtt_topic_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000020u; +} +inline const std::string& NSPanelSettings::button2_long_mqtt_topic() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:NSPanelSettings.button2_long_mqtt_topic) + return _internal_button2_long_mqtt_topic(); +} +template +inline PROTOBUF_ALWAYS_INLINE void NSPanelSettings::set_button2_long_mqtt_topic(Arg_&& arg, + Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.button2_long_mqtt_topic_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:NSPanelSettings.button2_long_mqtt_topic) +} +inline std::string* NSPanelSettings::mutable_button2_long_mqtt_topic() ABSL_ATTRIBUTE_LIFETIME_BOUND { + std::string* _s = _internal_mutable_button2_long_mqtt_topic(); + // @@protoc_insertion_point(field_mutable:NSPanelSettings.button2_long_mqtt_topic) + return _s; +} +inline const std::string& NSPanelSettings::_internal_button2_long_mqtt_topic() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.button2_long_mqtt_topic_.Get(); +} +inline void NSPanelSettings::_internal_set_button2_long_mqtt_topic(const std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.button2_long_mqtt_topic_.Set(value, GetArena()); +} +inline std::string* NSPanelSettings::_internal_mutable_button2_long_mqtt_topic() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000020u; + return _impl_.button2_long_mqtt_topic_.Mutable( GetArena()); +} +inline std::string* NSPanelSettings::release_button2_long_mqtt_topic() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:NSPanelSettings.button2_long_mqtt_topic) + if ((_impl_._has_bits_[0] & 0x00000020u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000020u; + auto* released = _impl_.button2_long_mqtt_topic_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.button2_long_mqtt_topic_.Set("", GetArena()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; +} +inline void NSPanelSettings::set_allocated_button2_long_mqtt_topic(std::string* value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000020u; + } else { + _impl_._has_bits_[0] &= ~0x00000020u; + } + _impl_.button2_long_mqtt_topic_.SetAllocated(value, GetArena()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.button2_long_mqtt_topic_.IsDefault()) { + _impl_.button2_long_mqtt_topic_.Set("", GetArena()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:NSPanelSettings.button2_long_mqtt_topic) +} + +// optional string button1_long_mqtt_payload = 46; +inline bool NSPanelSettings::has_button1_long_mqtt_payload() const { + bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; + return value; +} +inline void NSPanelSettings::clear_button1_long_mqtt_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_long_mqtt_payload_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000040u; +} +inline const std::string& NSPanelSettings::button1_long_mqtt_payload() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:NSPanelSettings.button1_long_mqtt_payload) + return _internal_button1_long_mqtt_payload(); +} +template +inline PROTOBUF_ALWAYS_INLINE void NSPanelSettings::set_button1_long_mqtt_payload(Arg_&& arg, + Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000040u; + _impl_.button1_long_mqtt_payload_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:NSPanelSettings.button1_long_mqtt_payload) +} +inline std::string* NSPanelSettings::mutable_button1_long_mqtt_payload() ABSL_ATTRIBUTE_LIFETIME_BOUND { + std::string* _s = _internal_mutable_button1_long_mqtt_payload(); + // @@protoc_insertion_point(field_mutable:NSPanelSettings.button1_long_mqtt_payload) + return _s; +} +inline const std::string& NSPanelSettings::_internal_button1_long_mqtt_payload() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.button1_long_mqtt_payload_.Get(); +} +inline void NSPanelSettings::_internal_set_button1_long_mqtt_payload(const std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000040u; + _impl_.button1_long_mqtt_payload_.Set(value, GetArena()); +} +inline std::string* NSPanelSettings::_internal_mutable_button1_long_mqtt_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000040u; + return _impl_.button1_long_mqtt_payload_.Mutable( GetArena()); +} +inline std::string* NSPanelSettings::release_button1_long_mqtt_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:NSPanelSettings.button1_long_mqtt_payload) + if ((_impl_._has_bits_[0] & 0x00000040u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000040u; + auto* released = _impl_.button1_long_mqtt_payload_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.button1_long_mqtt_payload_.Set("", GetArena()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; +} +inline void NSPanelSettings::set_allocated_button1_long_mqtt_payload(std::string* value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000040u; + } else { + _impl_._has_bits_[0] &= ~0x00000040u; + } + _impl_.button1_long_mqtt_payload_.SetAllocated(value, GetArena()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.button1_long_mqtt_payload_.IsDefault()) { + _impl_.button1_long_mqtt_payload_.Set("", GetArena()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:NSPanelSettings.button1_long_mqtt_payload) +} + +// optional string button2_long_mqtt_payload = 47; +inline bool NSPanelSettings::has_button2_long_mqtt_payload() const { + bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; + return value; +} +inline void NSPanelSettings::clear_button2_long_mqtt_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_long_mqtt_payload_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000080u; +} +inline const std::string& NSPanelSettings::button2_long_mqtt_payload() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:NSPanelSettings.button2_long_mqtt_payload) + return _internal_button2_long_mqtt_payload(); +} +template +inline PROTOBUF_ALWAYS_INLINE void NSPanelSettings::set_button2_long_mqtt_payload(Arg_&& arg, + Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000080u; + _impl_.button2_long_mqtt_payload_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:NSPanelSettings.button2_long_mqtt_payload) +} +inline std::string* NSPanelSettings::mutable_button2_long_mqtt_payload() ABSL_ATTRIBUTE_LIFETIME_BOUND { + std::string* _s = _internal_mutable_button2_long_mqtt_payload(); + // @@protoc_insertion_point(field_mutable:NSPanelSettings.button2_long_mqtt_payload) + return _s; +} +inline const std::string& NSPanelSettings::_internal_button2_long_mqtt_payload() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.button2_long_mqtt_payload_.Get(); +} +inline void NSPanelSettings::_internal_set_button2_long_mqtt_payload(const std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000080u; + _impl_.button2_long_mqtt_payload_.Set(value, GetArena()); +} +inline std::string* NSPanelSettings::_internal_mutable_button2_long_mqtt_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000080u; + return _impl_.button2_long_mqtt_payload_.Mutable( GetArena()); +} +inline std::string* NSPanelSettings::release_button2_long_mqtt_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:NSPanelSettings.button2_long_mqtt_payload) + if ((_impl_._has_bits_[0] & 0x00000080u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000080u; + auto* released = _impl_.button2_long_mqtt_payload_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.button2_long_mqtt_payload_.Set("", GetArena()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; +} +inline void NSPanelSettings::set_allocated_button2_long_mqtt_payload(std::string* value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000080u; + } else { + _impl_._has_bits_[0] &= ~0x00000080u; + } + _impl_.button2_long_mqtt_payload_.SetAllocated(value, GetArena()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.button2_long_mqtt_payload_.IsDefault()) { + _impl_.button2_long_mqtt_payload_.Set("", GetArena()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:NSPanelSettings.button2_long_mqtt_payload) +} + +// optional int32 button1_long_detached_light_id = 48; +inline bool NSPanelSettings::has_button1_long_detached_light_id() const { + bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; + return value; +} +inline void NSPanelSettings::clear_button1_long_detached_light_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_long_detached_light_id_ = 0; + _impl_._has_bits_[0] &= ~0x00000800u; +} +inline ::int32_t NSPanelSettings::button1_long_detached_light_id() const { + // @@protoc_insertion_point(field_get:NSPanelSettings.button1_long_detached_light_id) + return _internal_button1_long_detached_light_id(); +} +inline void NSPanelSettings::set_button1_long_detached_light_id(::int32_t value) { + _internal_set_button1_long_detached_light_id(value); + _impl_._has_bits_[0] |= 0x00000800u; + // @@protoc_insertion_point(field_set:NSPanelSettings.button1_long_detached_light_id) +} +inline ::int32_t NSPanelSettings::_internal_button1_long_detached_light_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.button1_long_detached_light_id_; +} +inline void NSPanelSettings::_internal_set_button1_long_detached_light_id(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_long_detached_light_id_ = value; +} + +// optional int32 button2_long_detached_light_id = 49; +inline bool NSPanelSettings::has_button2_long_detached_light_id() const { + bool value = (_impl_._has_bits_[0] & 0x00001000u) != 0; + return value; +} +inline void NSPanelSettings::clear_button2_long_detached_light_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_long_detached_light_id_ = 0; + _impl_._has_bits_[0] &= ~0x00001000u; +} +inline ::int32_t NSPanelSettings::button2_long_detached_light_id() const { + // @@protoc_insertion_point(field_get:NSPanelSettings.button2_long_detached_light_id) + return _internal_button2_long_detached_light_id(); +} +inline void NSPanelSettings::set_button2_long_detached_light_id(::int32_t value) { + _internal_set_button2_long_detached_light_id(value); + _impl_._has_bits_[0] |= 0x00001000u; + // @@protoc_insertion_point(field_set:NSPanelSettings.button2_long_detached_light_id) +} +inline ::int32_t NSPanelSettings::_internal_button2_long_detached_light_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.button2_long_detached_light_id_; +} +inline void NSPanelSettings::_internal_set_button2_long_detached_light_id(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_long_detached_light_id_ = value; +} + +// bool denied = 50; inline void NSPanelSettings::clear_denied() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.denied_ = false; @@ -2116,7 +2816,7 @@ inline void NSPanelSettings::_internal_set_denied(bool value) { _impl_.denied_ = value; } -// bool accepted = 46; +// bool accepted = 51; inline void NSPanelSettings::clear_accepted() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.accepted_ = false; @@ -2138,7 +2838,7 @@ inline void NSPanelSettings::_internal_set_accepted(bool value) { _impl_.accepted_ = value; } -// repeated int32 rooms = 47; +// repeated int32 rooms = 52; inline int NSPanelSettings::_internal_rooms_size() const { return _internal_rooms().size(); } @@ -2183,7 +2883,7 @@ inline ::google::protobuf::RepeatedField<::int32_t>* NSPanelSettings::_internal_ return &_impl_.rooms_; } -// repeated int32 scenes = 48; +// repeated int32 scenes = 53; inline int NSPanelSettings::_internal_scenes_size() const { return _internal_scenes().size(); } @@ -2228,7 +2928,7 @@ inline ::google::protobuf::RepeatedField<::int32_t>* NSPanelSettings::_internal_ return &_impl_.scenes_; } -// string ip_address = 49; +// string ip_address = 54; inline void NSPanelSettings::clear_ip_address() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.ip_address_.ClearToEmpty(); @@ -2278,7 +2978,7 @@ inline void NSPanelSettings::set_allocated_ip_address(std::string* value) { // @@protoc_insertion_point(field_set_allocated:NSPanelSettings.ip_address) } -// .NSPanelSettings.RelayRegisterType relay1_register_type = 50; +// .NSPanelSettings.RelayRegisterType relay1_register_type = 55; inline void NSPanelSettings::clear_relay1_register_type() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.relay1_register_type_ = 0; @@ -2300,7 +3000,7 @@ inline void NSPanelSettings::_internal_set_relay1_register_type(::NSPanelSetting _impl_.relay1_register_type_ = value; } -// .NSPanelSettings.RelayRegisterType relay2_register_type = 51; +// .NSPanelSettings.RelayRegisterType relay2_register_type = 56; inline void NSPanelSettings::clear_relay2_register_type() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.relay2_register_type_ = 0; @@ -2322,7 +3022,7 @@ inline void NSPanelSettings::_internal_set_relay2_register_type(::NSPanelSetting _impl_.relay2_register_type_ = value; } -// int32 default_room = 52; +// int32 default_room = 57; inline void NSPanelSettings::clear_default_room() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.default_room_ = 0; @@ -2426,6 +3126,12 @@ inline const EnumDescriptor* GetEnumDescriptor<::NSPanelSettings_NSPanelButtonMo return ::NSPanelSettings_NSPanelButtonMode_descriptor(); } template <> +struct is_proto_enum<::NSPanelSettings_NSPanelButtonFallbackMode> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::NSPanelSettings_NSPanelButtonFallbackMode>() { + return ::NSPanelSettings_NSPanelButtonFallbackMode_descriptor(); +} +template <> struct is_proto_enum<::NSPanelSettings_RelayRegisterType> : std::true_type {}; template <> inline const EnumDescriptor* GetEnumDescriptor<::NSPanelSettings_RelayRegisterType>() { diff --git a/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.cc b/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.cc index cf9e21ed..956aa60e 100644 --- a/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.cc +++ b/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.cc @@ -321,6 +321,25 @@ struct NSPanelMQTTManagerCommand_ButtonPressedDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NSPanelMQTTManagerCommand_ButtonPressedDefaultTypeInternal _NSPanelMQTTManagerCommand_ButtonPressed_default_instance_; +inline constexpr NSPanelMQTTManagerCommand_ButtonLongPressed::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : button_id_{0}, + _cached_size_{0} {} + +template +PROTOBUF_CONSTEXPR NSPanelMQTTManagerCommand_ButtonLongPressed::NSPanelMQTTManagerCommand_ButtonLongPressed(::_pbi::ConstantInitialized) + : _impl_(::_pbi::ConstantInitialized()) {} +struct NSPanelMQTTManagerCommand_ButtonLongPressedDefaultTypeInternal { + PROTOBUF_CONSTEXPR NSPanelMQTTManagerCommand_ButtonLongPressedDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~NSPanelMQTTManagerCommand_ButtonLongPressedDefaultTypeInternal() {} + union { + NSPanelMQTTManagerCommand_ButtonLongPressed _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NSPanelMQTTManagerCommand_ButtonLongPressedDefaultTypeInternal _NSPanelMQTTManagerCommand_ButtonLongPressed_default_instance_; + inline constexpr NSPanelLightStatus::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : name_( @@ -432,6 +451,9 @@ inline constexpr NSPanelStatusReport::Impl_::Impl_( md5_tft_gui_( &::google::protobuf::internal::fixed_address_empty_string, ::_pbi::ConstantInitialized()), + version_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), nspanel_state_{static_cast< ::NSPanelStatusReport_state >(0)}, update_progress_{0}, rssi_{0}, @@ -533,7 +555,13 @@ inline constexpr NSPanelConfig::Impl_::Impl_( relay2_default_mode_{false}, temperature_calibration_{0}, button1_mode_{static_cast< ::NSPanelConfig_NSPanelButtonMode >(0)}, + button1_fallback_mode_{static_cast< ::NSPanelConfig_NSPanelButtonFallbackMode >(0)}, button2_mode_{static_cast< ::NSPanelConfig_NSPanelButtonMode >(0)}, + button2_fallback_mode_{static_cast< ::NSPanelConfig_NSPanelButtonFallbackMode >(0)}, + button1_long_mode_{static_cast< ::NSPanelConfig_NSPanelButtonMode >(0)}, + button1_long_fallback_mode_{static_cast< ::NSPanelConfig_NSPanelButtonFallbackMode >(0)}, + button2_long_mode_{static_cast< ::NSPanelConfig_NSPanelButtonMode >(0)}, + button2_long_fallback_mode_{static_cast< ::NSPanelConfig_NSPanelButtonFallbackMode >(0)}, raise_light_level_to_100_above_{0}, nspanel_id_{0}, optimistic_mode_{false}, @@ -558,7 +586,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[6]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_protobuf_5fnspanel_2eproto[7]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_protobuf_5fnspanel_2eproto = nullptr; const ::uint32_t @@ -605,7 +633,13 @@ const ::uint32_t PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.relay2_default_mode_), PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.temperature_calibration_), PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.button1_mode_), + PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.button1_fallback_mode_), PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.button2_mode_), + PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.button2_fallback_mode_), + PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.button1_long_mode_), + PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.button1_long_fallback_mode_), + PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.button2_long_mode_), + PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.button2_long_fallback_mode_), PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.global_scene_entity_page_ids_), PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.optimistic_mode_), PROTOBUF_FIELD_OFFSET(::NSPanelConfig, _impl_.raise_light_level_to_100_above_), @@ -648,6 +682,7 @@ const ::uint32_t PROTOBUF_FIELD_OFFSET(::NSPanelStatusReport, _impl_.md5_firmware_), PROTOBUF_FIELD_OFFSET(::NSPanelStatusReport, _impl_.md5_littlefs_), PROTOBUF_FIELD_OFFSET(::NSPanelStatusReport, _impl_.md5_tft_gui_), + PROTOBUF_FIELD_OFFSET(::NSPanelStatusReport, _impl_.version_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::NSPanelLightStatus, _internal_metadata_), ~0u, // no _extensions_ @@ -815,6 +850,15 @@ const ::uint32_t ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::NSPanelMQTTManagerCommand_ButtonPressed, _impl_.button_id_), ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::NSPanelMQTTManagerCommand_ButtonLongPressed, _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(::NSPanelMQTTManagerCommand_ButtonLongPressed, _impl_.button_id_), + ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::NSPanelMQTTManagerCommand_ThermostatTemperatureCommand, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -851,6 +895,7 @@ const ::uint32_t ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::NSPanelMQTTManagerCommand, _impl_.nspanel_id_), PROTOBUF_FIELD_OFFSET(::NSPanelMQTTManagerCommand, _impl_.CommandData_), }; @@ -859,23 +904,24 @@ 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)}, - {84, -1, -1, sizeof(::NSPanelLightStatus)}, - {102, -1, -1, sizeof(::NSPanelRoomEntitiesPage_EntitySlot)}, - {117, -1, -1, sizeof(::NSPanelRoomEntitiesPage)}, - {129, -1, -1, sizeof(::NSPanelRoomStatus)}, - {150, -1, -1, sizeof(::NSPanelWeatherUpdate_ForecastItem)}, - {163, -1, -1, sizeof(::NSPanelWeatherUpdate)}, - {179, -1, -1, sizeof(::NSPanelMQTTManagerCommand_FirstPageTurnLightOn)}, - {194, -1, -1, sizeof(::NSPanelMQTTManagerCommand_FirstPageTurnLightOff)}, - {204, -1, -1, sizeof(::NSPanelMQTTManagerCommand_LightCommand)}, - {221, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ToggleEntityFromEntitiesPage)}, - {231, -1, -1, sizeof(::NSPanelMQTTManagerCommand_SaveSceneCommand)}, - {241, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ButtonPressed)}, - {250, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ThermostatTemperatureCommand)}, - {260, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ThermostatCommand)}, - {271, -1, -1, sizeof(::NSPanelMQTTManagerCommand)}, + {61, -1, -1, sizeof(::NSPanelWarning)}, + {71, -1, -1, sizeof(::NSPanelStatusReport)}, + {91, -1, -1, sizeof(::NSPanelLightStatus)}, + {109, -1, -1, sizeof(::NSPanelRoomEntitiesPage_EntitySlot)}, + {124, -1, -1, sizeof(::NSPanelRoomEntitiesPage)}, + {136, -1, -1, sizeof(::NSPanelRoomStatus)}, + {157, -1, -1, sizeof(::NSPanelWeatherUpdate_ForecastItem)}, + {170, -1, -1, sizeof(::NSPanelWeatherUpdate)}, + {186, -1, -1, sizeof(::NSPanelMQTTManagerCommand_FirstPageTurnLightOn)}, + {201, -1, -1, sizeof(::NSPanelMQTTManagerCommand_FirstPageTurnLightOff)}, + {211, -1, -1, sizeof(::NSPanelMQTTManagerCommand_LightCommand)}, + {228, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ToggleEntityFromEntitiesPage)}, + {238, -1, -1, sizeof(::NSPanelMQTTManagerCommand_SaveSceneCommand)}, + {248, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ButtonPressed)}, + {257, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ButtonLongPressed)}, + {266, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ThermostatTemperatureCommand)}, + {276, -1, -1, sizeof(::NSPanelMQTTManagerCommand_ThermostatCommand)}, + {287, -1, -1, sizeof(::NSPanelMQTTManagerCommand)}, }; static const ::_pb::Message* const file_default_instances[] = { &::_NSPanelConfig_RoomInfo_default_instance_._instance, @@ -894,13 +940,14 @@ static const ::_pb::Message* const file_default_instances[] = { &::_NSPanelMQTTManagerCommand_ToggleEntityFromEntitiesPage_default_instance_._instance, &::_NSPanelMQTTManagerCommand_SaveSceneCommand_default_instance_._instance, &::_NSPanelMQTTManagerCommand_ButtonPressed_default_instance_._instance, + &::_NSPanelMQTTManagerCommand_ButtonLongPressed_default_instance_._instance, &::_NSPanelMQTTManagerCommand_ThermostatTemperatureCommand_default_instance_._instance, &::_NSPanelMQTTManagerCommand_ThermostatCommand_default_instance_._instance, &::_NSPanelMQTTManagerCommand_default_instance_._instance, }; 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\"\207\021\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" @@ -920,131 +967,147 @@ const char descriptor_table_protodef_protobuf_5fnspanel_2eproto[] ABSL_ATTRIBUTE "e\030\023 \001(\010\022\033\n\023relay2_default_mode\030\024 \001(\010\022\037\n\027" "temperature_calibration\030\025 \001(\005\0226\n\014button1" "_mode\030\026 \001(\0162 .NSPanelConfig.NSPanelButto" - "nMode\0226\n\014button2_mode\030\031 \001(\0162 .NSPanelCon" - "fig.NSPanelButtonMode\022$\n\034global_scene_en" - "tity_page_ids\030\036 \003(\005\022\027\n\017optimistic_mode\030\037" - " \001(\010\022&\n\036raise_light_level_to_100_above\030 " - " \001(\005\022\022\n\nnspanel_id\030! \001(\005\022\032\n\022relay1_relay" - "_group\030# \003(\005\022\032\n\022relay2_relay_group\030% \003(\005" - "\022\037\n\027default_light_brightess\030& \001(\005\022\036\n\026loc" - "ked_to_default_room\030\' \001(\010\022,\n$inside_temp" - "erature_sensor_mqtt_topic\030( \001(\t\022!\n\031butto" - "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\"\212\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\"`\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\"\325\001\n\022NSPanelLightStatus\022\n\n\002id" - "\030\001 \001(\005\022\014\n\004name\030\002 \001(\t\022\017\n\007can_dim\030\003 \001(\010\022\035\n" - "\025can_color_temperature\030\004 \001(\010\022\017\n\007can_rgb\030" - "\005 \001(\010\022\023\n\013light_level\030\006 \001(\005\022\022\n\ncolor_temp" - "\030\007 \001(\005\022\013\n\003hue\030\010 \001(\005\022\022\n\nsaturation\030\t \001(\005\022" - "\032\n\022room_view_position\030\n \001(\005\"\230\002\n\027NSPanelR" - "oomEntitiesPage\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.EntitySl" - "ot\032\221\001\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\"\226\003\n\021NSPan" - "elRoomStatus\022\n\n\002id\030\001 \001(\005\022\014\n\004name\030\002 \001(\t\022\031" - "\n\021average_dim_level\030\003 \001(\005\022 \n\030ceiling_lig" - "hts_dim_level\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&ceiling_lights_color_temperatu" - "re_value\030\007 \001(\005\022,\n$table_lights_color_tem" - "perature_value\030\010 \001(\005\022\032\n\022num_ceiling_ligh" - "ts\030\t \001(\005\022\030\n\020num_table_lights\030\n \001(\005\022\035\n\025nu" - "m_ceiling_lights_on\030\013 \001(\005\022\033\n\023num_table_l" - "ights_on\030\014 \001(\005\022\027\n\017entity_page_ids\030\r \003(\005\"" - "\277\003\n\024NSPanelWeatherUpdate\022:\n\016forecast_ite" - "ms\030\001 \003(\0132\".NSPanelWeatherUpdate.Forecast" - "Item\022\034\n\024current_weather_icon\030\002 \001(\t\022\"\n\032cu" - "rrent_temperature_string\030\003 \001(\t\022\"\n\032curren" - "t_maxmin_temperature\030\004 \001(\t\022\033\n\023current_wi" - "nd_string\030\005 \001(\t\022\026\n\016sunrise_string\030\006 \001(\t\022" - "\025\n\rsunset_string\030\007 \001(\t\022$\n\034current_precip" - "itation_string\030\010 \001(\t\032\222\001\n\014ForecastItem\022\024\n" - "\014weather_icon\030\001 \001(\t\022\034\n\024precipitation_str" - "ing\030\002 \001(\t\022!\n\031temperature_maxmin_string\030\003" - " \001(\t\022\023\n\013wind_string\030\004 \001(\t\022\026\n\016display_str" - "ing\030\005 \001(\t\"\227\r\n\031NSPanelMQTTManagerCommand\022" - "M\n\022first_page_turn_on\030\001 \001(\0132/.NSPanelMQT" - "TManagerCommand.FirstPageTurnLightOnH\000\022O" - "\n\023first_page_turn_off\030\002 \001(\01320.NSPanelMQT" - "TManagerCommand.FirstPageTurnLightOffH\000\022" - "@\n\rlight_command\030\003 \001(\0132\'.NSPanelMQTTMana" - "gerCommand.LightCommandH\000\022c\n toggle_enti" - "ty_from_entities_page\030\004 \001(\01327.NSPanelMQT" - "TManagerCommand.ToggleEntityFromEntities" - "PageH\000\022I\n\022save_scene_command\030\005 \001(\0132+.NSP" - "anelMQTTManagerCommand.SaveSceneCommandH" - "\000\022B\n\016button_pressed\030\006 \001(\0132(.NSPanelMQTTM" - "anagerCommand.ButtonPressedH\000\022a\n\036thermos" - "tat_temperature_command\030\007 \001(\01327.NSPanelM" - "QTTManagerCommand.ThermostatTemperatureC" - "ommandH\000\022J\n\022thermostat_command\030\010 \001(\0132,.N" - "SPanelMQTTManagerCommand.ThermostatComma" - "ndH\000\022\022\n\nnspanel_id\030d \001(\005\032\372\001\n\024FirstPageTu" - "rnLightOn\022E\n\raffect_lights\030\001 \001(\0162..NSPan" - "elMQTTManagerCommand.AffectLightsOptions" - "\022\037\n\027brightness_slider_value\030\002 \001(\005\022\033\n\023kel" - "vin_slider_value\030\003 \001(\005\022\025\n\rselected_room\030" - "\004 \001(\005\022\016\n\006global\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" - "\025FirstPageTurnLightOff\022E\n\raffect_lights\030" - "\001 \001(\0162..NSPanelMQTTManagerCommand.Affect" - "LightsOptions\022\016\n\006global\030\002 \001(\010\032\321\001\n\014LightC" - "ommand\022\021\n\tlight_ids\030\001 \003(\005\022\026\n\016has_brightn" - "ess\030\002 \001(\010\022\022\n\nbrightness\030\003 \001(\005\022\035\n\025has_col" - "or_temperature\030\004 \001(\010\022\031\n\021color_temperatur" - "e\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\nsaturation\030\t \001(" - "\005\032K\n\034ToggleEntityFromEntitiesPage\022\026\n\016ent" - "ity_page_id\030\001 \001(\005\022\023\n\013entity_slot\030\002 \001(\005\032\?" - "\n\020SaveSceneCommand\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_id\030\002 \001(\005\032J\n\034ThermostatTempera" - "tureCommand\022\025\n\rthermostat_id\030\001 \001(\005\022\023\n\013te" - "mperature\030\002 \001(\002\032M\n\021ThermostatCommand\022\025\n\r" - "thermostat_id\030\001 \001(\005\022\016\n\006option\030\002 \001(\t\022\021\n\tn" - "ew_value\030\003 \001(\t\"D\n\023AffectLightsOptions\022\007\n" - "\003ALL\020\000\022\020\n\014TABLE_LIGHTS\020\001\022\022\n\016CEILING_LIGH" - "TS\020\002B\r\n\013CommandData*[\n\023NSPanelWarningLev" - "el\022\014\n\010CRITICAL\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" + "nMode\022G\n\025button1_fallback_mode\030\027 \001(\0162(.N" + "SPanelConfig.NSPanelButtonFallbackMode\0226" + "\n\014button2_mode\030\030 \001(\0162 .NSPanelConfig.NSP" + "anelButtonMode\022G\n\025button2_fallback_mode\030" + "\031 \001(\0162(.NSPanelConfig.NSPanelButtonFallb" + "ackMode\022;\n\021button1_long_mode\030\032 \001(\0162 .NSP" + "anelConfig.NSPanelButtonMode\022L\n\032button1_" + "long_fallback_mode\030\033 \001(\0162(.NSPanelConfig" + ".NSPanelButtonFallbackMode\022;\n\021button2_lo" + "ng_mode\030\034 \001(\0162 .NSPanelConfig.NSPanelBut" + "tonMode\022L\n\032button2_long_fallback_mode\030\035 " + "\001(\0162(.NSPanelConfig.NSPanelButtonFallbac" + "kMode\022$\n\034global_scene_entity_page_ids\030\036 " + "\003(\005\022\027\n\017optimistic_mode\030\037 \001(\010\022&\n\036raise_li" + "ght_level_to_100_above\030 \001(\005\022\022\n\nnspanel_" + "id\030! \001(\005\022\032\n\022relay1_relay_group\030# \003(\005\022\032\n\022" + "relay2_relay_group\030% \003(\005\022\037\n\027default_ligh" + "t_brightess\030& \001(\005\022\036\n\026locked_to_default_r" + "oom\030\' \001(\010\022,\n$inside_temperature_sensor_m" + "qtt_topic\030( \001(\t\022!\n\031button1_lower_tempera" + "ture\030) \001(\005\022!\n\031button1_upper_temperature\030" + "* \001(\005\022!\n\031button2_lower_temperature\030+ \001(\005" + "\022!\n\031button2_upper_temperature\030, \001(\005\032L\n\010R" + "oomInfo\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\022NSP" + "anelDefaultPage\022\010\n\004HOME\020\000\022\n\n\006SCENES\020\001\022\014\n" + "\010ENTITIES\020\002\"\250\001\n\026NSPanelScreensaverMode\022\033" + "\n\027WEATHER_WITH_BACKGROUND\020\000\022\036\n\032WEATHER_W" + "ITHOUT_BACKGROUND\020\001\022\034\n\030DATETIME_WITH_BAC" + "KGROUND\020\003\022\037\n\033DATETIME_WITHOUT_BACKGROUND" + "\020\004\022\022\n\016NO_SCREENSAVER\020\005\"i\n\021NSPanelButtonM" + "ode\022\n\n\006DIRECT\020\000\022\n\n\006FOLLOW\020\001\022\022\n\016NOTIFY_MA" + "NAGER\020\002\022\023\n\017THERMOSTAT_HEAT\020\003\022\023\n\017THERMOST" + "AT_COOL\020\004\"O\n\031NSPanelButtonFallbackMode\022\014" + "\n\010DISABLED\020\000\022\021\n\rTOGGLE_RELAY1\020\001\022\021\n\rTOGLL" + "E_RELAY2\020\002\"C\n\016NSPanelWarning\022#\n\005level\030\001 " + "\001(\0162\024.NSPanelWarningLevel\022\014\n\004text\030\002 \001(\t\"" + "\233\003\n\023NSPanelStatusReport\0221\n\rnspanel_state" + "\030\001 \001(\0162\032.NSPanelStatusReport.state\022\027\n\017up" + "date_progress\030\002 \001(\005\022\014\n\004rssi\030\003 \001(\005\022\025\n\rhea" + "p_used_pct\030\004 \001(\005\022\023\n\013mac_address\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.NSPanelWarning\022\024\n\014md5" + "_firmware\030\t \001(\t\022\024\n\014md5_littlefs\030\n \001(\t\022\023\n" + "\013md5_tft_gui\030\013 \001(\t\022\017\n\007version\030\014 \001(\t\"`\n\005s" + "tate\022\n\n\006ONLINE\020\000\022\013\n\007OFFLINE\020\001\022\020\n\014UPDATIN" + "G_TFT\020\002\022\025\n\021UPDATING_FIRMWARE\020\003\022\025\n\021UPDATI" + "NG_LITTLEFS\020\004\"\325\001\n\022NSPanelLightStatus\022\n\n\002" + "id\030\001 \001(\005\022\014\n\004name\030\002 \001(\t\022\017\n\007can_dim\030\003 \001(\010\022" + "\035\n\025can_color_temperature\030\004 \001(\010\022\017\n\007can_rg" + "b\030\005 \001(\010\022\023\n\013light_level\030\006 \001(\005\022\022\n\ncolor_te" + "mp\030\007 \001(\005\022\013\n\003hue\030\010 \001(\005\022\022\n\nsaturation\030\t \001(" + "\005\022\032\n\022room_view_position\030\n \001(\005\"\230\002\n\027NSPane" + "lRoomEntitiesPage\022\n\n\002id\030\001 \001(\005\022\021\n\tpage_ty" + "pe\030\002 \001(\005\022\023\n\013header_text\030\003 \001(\t\0225\n\010entitie" + "s\030\004 \003(\0132#.NSPanelRoomEntitiesPage.Entity" + "Slot\032\221\001\n\nEntitySlot\022\032\n\022room_view_positio" + "n\030\001 \001(\005\022\014\n\004name\030\002 \001(\t\022\014\n\004icon\030\003 \001(\t\022\013\n\003p" + "co\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\"\226\003\n\021NSP" + "anelRoomStatus\022\n\n\002id\030\001 \001(\005\022\014\n\004name\030\002 \001(\t" + "\022\031\n\021average_dim_level\030\003 \001(\005\022 \n\030ceiling_l" + "ights_dim_level\030\004 \001(\005\022\036\n\026table_lights_di" + "m_level\030\005 \001(\005\022!\n\031average_color_temperatu" + "re\030\006 \001(\005\022.\n&ceiling_lights_color_tempera" + "ture_value\030\007 \001(\005\022,\n$table_lights_color_t" + "emperature_value\030\010 \001(\005\022\032\n\022num_ceiling_li" + "ghts\030\t \001(\005\022\030\n\020num_table_lights\030\n \001(\005\022\035\n\025" + "num_ceiling_lights_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\024NSPanelWeatherUpdate\022:\n\016forecast_i" + "tems\030\001 \003(\0132\".NSPanelWeatherUpdate.Foreca" + "stItem\022\034\n\024current_weather_icon\030\002 \001(\t\022\"\n\032" + "current_temperature_string\030\003 \001(\t\022\"\n\032curr" + "ent_maxmin_temperature\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_string\030\007 \001(\t\022$\n\034current_prec" + "ipitation_string\030\010 \001(\t\032\222\001\n\014ForecastItem\022" + "\024\n\014weather_icon\030\001 \001(\t\022\034\n\024precipitation_s" + "tring\030\002 \001(\t\022!\n\031temperature_maxmin_string" + "\030\003 \001(\t\022\023\n\013wind_string\030\004 \001(\t\022\026\n\016display_s" + "tring\030\005 \001(\t\"\213\016\n\031NSPanelMQTTManagerComman" + "d\022M\n\022first_page_turn_on\030\001 \001(\0132/.NSPanelM" + "QTTManagerCommand.FirstPageTurnLightOnH\000" + "\022O\n\023first_page_turn_off\030\002 \001(\01320.NSPanelM" + "QTTManagerCommand.FirstPageTurnLightOffH" + "\000\022@\n\rlight_command\030\003 \001(\0132\'.NSPanelMQTTMa" + "nagerCommand.LightCommandH\000\022c\n toggle_en" + "tity_from_entities_page\030\004 \001(\01327.NSPanelM" + "QTTManagerCommand.ToggleEntityFromEntiti" + "esPageH\000\022I\n\022save_scene_command\030\005 \001(\0132+.N" + "SPanelMQTTManagerCommand.SaveSceneComman" + "dH\000\022B\n\016button_pressed\030\006 \001(\0132(.NSPanelMQT" + "TManagerCommand.ButtonPressedH\000\022J\n\022butto" + "n_longpressed\030\007 \001(\0132,.NSPanelMQTTManager" + "Command.ButtonLongPressedH\000\022a\n\036thermosta" + "t_temperature_command\030\010 \001(\01327.NSPanelMQT" + "TManagerCommand.ThermostatTemperatureCom" + "mandH\000\022J\n\022thermostat_command\030\t \001(\0132,.NSP" + "anelMQTTManagerCommand.ThermostatCommand" + "H\000\022\022\n\nnspanel_id\030d \001(\005\032\372\001\n\024FirstPageTurn" + "LightOn\022E\n\raffect_lights\030\001 \001(\0162..NSPanel" + "MQTTManagerCommand.AffectLightsOptions\022\037" + "\n\027brightness_slider_value\030\002 \001(\005\022\033\n\023kelvi" + "n_slider_value\030\003 \001(\005\022\025\n\rselected_room\030\004 " + "\001(\005\022\016\n\006global\030\005 \001(\010\022\034\n\024has_brightness_va" + "lue\030\006 \001(\010\022\030\n\020has_kelvin_value\030\007 \001(\010\032n\n\025F" + "irstPageTurnLightOff\022E\n\raffect_lights\030\001 " + "\001(\0162..NSPanelMQTTManagerCommand.AffectLi" + "ghtsOptions\022\016\n\006global\030\002 \001(\010\032\321\001\n\014LightCom" + "mand\022\021\n\tlight_ids\030\001 \003(\005\022\026\n\016has_brightnes" + "s\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_temperature\030" + "\005 \001(\005\022\017\n\007has_hue\030\006 \001(\010\022\013\n\003hue\030\007 \001(\005\022\026\n\016h" + "as_saturation\030\010 \001(\010\022\022\n\nsaturation\030\t \001(\005\032" + "K\n\034ToggleEntityFromEntitiesPage\022\026\n\016entit" + "y_page_id\030\001 \001(\005\022\023\n\013entity_slot\030\002 \001(\005\032\?\n\020" + "SaveSceneCommand\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_id\030\002 \001(\005\032&\n\021ButtonLongPressed\022\021" + "\n\tbutton_id\030\002 \001(\005\032J\n\034ThermostatTemperatu" + "reCommand\022\025\n\rthermostat_id\030\001 \001(\005\022\023\n\013temp" + "erature\030\002 \001(\002\032M\n\021ThermostatCommand\022\025\n\rth" + "ermostat_id\030\001 \001(\005\022\016\n\006option\030\002 \001(\t\022\021\n\tnew" + "_value\030\003 \001(\t\"D\n\023AffectLightsOptions\022\007\n\003A" + "LL\020\000\022\020\n\014TABLE_LIGHTS\020\001\022\022\n\016CEILING_LIGHTS" + "\020\002B\r\n\013CommandData*[\n\023NSPanelWarningLevel" + "\022\014\n\010CRITICAL\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, - 5320, + 5958, 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, @@ -1118,10 +1181,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_NSPanelButtonFallbackMode_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_NSPanelButtonFallbackMode_internal_data_[] = { + 196608u, 0u, }; +bool NSPanelConfig_NSPanelButtonFallbackMode_IsValid(int value) { + return 0 <= value && value <= 2; +} +#if (__cplusplus < 201703) && \ + (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) + +constexpr NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig::DISABLED; +constexpr NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig::TOGGLE_RELAY1; +constexpr NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig::TOGLLE_RELAY2; +constexpr NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig::NSPanelButtonFallbackMode_MIN; +constexpr NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig::NSPanelButtonFallbackMode_MAX; +constexpr int NSPanelConfig::NSPanelButtonFallbackMode_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_[] = { 327680u, 0u, }; bool NSPanelStatusReport_state_IsValid(int value) { @@ -1143,7 +1227,7 @@ constexpr int NSPanelStatusReport::state_ARRAYSIZE; // (!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[4]; + return file_level_enum_descriptors_protobuf_5fnspanel_2eproto[5]; } PROTOBUF_CONSTINIT const uint32_t NSPanelMQTTManagerCommand_AffectLightsOptions_internal_data_[] = { 196608u, 0u, }; @@ -1164,7 +1248,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[5]; + return file_level_enum_descriptors_protobuf_5fnspanel_2eproto[6]; } PROTOBUF_CONSTINIT const uint32_t NSPanelWarningLevel_internal_data_[] = { 393216u, 0u, }; @@ -1528,15 +1612,15 @@ 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, 42, 1, 102, 7> NSPanelConfig::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ 44, 248, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 515899392, // skipmap + 0, // skipmap offsetof(decltype(_table_), field_entries), - 36, // num_field_entries + 42, // num_field_entries 1, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_NSPanelConfig_default_instance_._instance, @@ -1613,25 +1697,27 @@ const ::_pbi::TcParseTable<5, 36, 1, 94, 7> NSPanelConfig::_table_ = { // .NSPanelConfig.NSPanelButtonMode button1_mode = 22; {::_pbi::TcParser::FastV32S2, {432, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button1_mode_)}}, - // bool locked_to_default_room = 39; - {::_pbi::TcParser::FastV8S2, - {696, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.locked_to_default_room_)}}, - // string inside_temperature_sensor_mqtt_topic = 40; - {::_pbi::TcParser::FastUS2, - {706, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.inside_temperature_sensor_mqtt_topic_)}}, - // .NSPanelConfig.NSPanelButtonMode button2_mode = 25; + // .NSPanelConfig.NSPanelButtonFallbackMode button1_fallback_mode = 23; {::_pbi::TcParser::FastV32S2, - {456, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button2_mode_)}}, - // int32 button1_upper_temperature = 42; + {440, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button1_fallback_mode_)}}, + // .NSPanelConfig.NSPanelButtonMode button2_mode = 24; {::_pbi::TcParser::FastV32S2, - {720, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button1_upper_temperature_)}}, - // int32 button2_lower_temperature = 43; + {448, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button2_mode_)}}, + // .NSPanelConfig.NSPanelButtonFallbackMode button2_fallback_mode = 25; {::_pbi::TcParser::FastV32S2, - {728, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button2_lower_temperature_)}}, - // int32 button2_upper_temperature = 44; + {456, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button2_fallback_mode_)}}, + // .NSPanelConfig.NSPanelButtonMode button1_long_mode = 26; {::_pbi::TcParser::FastV32S2, - {736, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button2_upper_temperature_)}}, - {::_pbi::TcParser::MiniParse, {}}, + {464, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button1_long_mode_)}}, + // .NSPanelConfig.NSPanelButtonFallbackMode button1_long_fallback_mode = 27; + {::_pbi::TcParser::FastV32S2, + {472, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button1_long_fallback_mode_)}}, + // .NSPanelConfig.NSPanelButtonMode button2_long_mode = 28; + {::_pbi::TcParser::FastV32S2, + {480, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button2_long_mode_)}}, + // .NSPanelConfig.NSPanelButtonFallbackMode button2_long_fallback_mode = 29; + {::_pbi::TcParser::FastV32S2, + {488, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button2_long_fallback_mode_)}}, // repeated int32 global_scene_entity_page_ids = 30; {::_pbi::TcParser::FastV32P2, {498, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.global_scene_entity_page_ids_)}}, @@ -1640,7 +1726,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, + 61450, 32, 65535, 65535 }}, {{ // string name = 1; @@ -1709,9 +1795,27 @@ const ::_pbi::TcParseTable<5, 36, 1, 94, 7> NSPanelConfig::_table_ = { // .NSPanelConfig.NSPanelButtonMode button1_mode = 22; {PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button1_mode_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // .NSPanelConfig.NSPanelButtonMode button2_mode = 25; + // .NSPanelConfig.NSPanelButtonFallbackMode button1_fallback_mode = 23; + {PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button1_fallback_mode_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // .NSPanelConfig.NSPanelButtonMode button2_mode = 24; {PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button2_mode_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // .NSPanelConfig.NSPanelButtonFallbackMode button2_fallback_mode = 25; + {PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button2_fallback_mode_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // .NSPanelConfig.NSPanelButtonMode button1_long_mode = 26; + {PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button1_long_mode_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // .NSPanelConfig.NSPanelButtonFallbackMode button1_long_fallback_mode = 27; + {PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button1_long_fallback_mode_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // .NSPanelConfig.NSPanelButtonMode button2_long_mode = 28; + {PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button2_long_mode_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + // .NSPanelConfig.NSPanelButtonFallbackMode button2_long_fallback_mode = 29; + {PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.button2_long_fallback_mode_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, // repeated int32 global_scene_entity_page_ids = 30; {PROTOBUF_FIELD_OFFSET(NSPanelConfig, _impl_.global_scene_entity_page_ids_), 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kPackedInt32)}, @@ -1754,7 +1858,7 @@ const ::_pbi::TcParseTable<5, 36, 1, 94, 7> NSPanelConfig::_table_ = { }}, {{ {::_pbi::TcParser::GetTable<::NSPanelConfig_RoomInfo>()}, }}, {{ - "\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" + "\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\0\0\0\0\0\0\44\0\0\0\0\0\0\0\0\0" "NSPanelConfig" "name" "inside_temperature_sensor_mqtt_topic" @@ -1946,11 +2050,53 @@ ::uint8_t* NSPanelConfig::_InternalSerialize( 22, this->_internal_button1_mode(), target); } - // .NSPanelConfig.NSPanelButtonMode button2_mode = 25; + // .NSPanelConfig.NSPanelButtonFallbackMode button1_fallback_mode = 23; + if (this->_internal_button1_fallback_mode() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 23, this->_internal_button1_fallback_mode(), target); + } + + // .NSPanelConfig.NSPanelButtonMode button2_mode = 24; if (this->_internal_button2_mode() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 25, this->_internal_button2_mode(), target); + 24, this->_internal_button2_mode(), target); + } + + // .NSPanelConfig.NSPanelButtonFallbackMode button2_fallback_mode = 25; + if (this->_internal_button2_fallback_mode() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 25, this->_internal_button2_fallback_mode(), target); + } + + // .NSPanelConfig.NSPanelButtonMode button1_long_mode = 26; + if (this->_internal_button1_long_mode() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 26, this->_internal_button1_long_mode(), target); + } + + // .NSPanelConfig.NSPanelButtonFallbackMode button1_long_fallback_mode = 27; + if (this->_internal_button1_long_fallback_mode() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 27, this->_internal_button1_long_fallback_mode(), target); + } + + // .NSPanelConfig.NSPanelButtonMode button2_long_mode = 28; + if (this->_internal_button2_long_mode() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 28, this->_internal_button2_long_mode(), target); + } + + // .NSPanelConfig.NSPanelButtonFallbackMode button2_long_fallback_mode = 29; + if (this->_internal_button2_long_fallback_mode() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 29, this->_internal_button2_long_fallback_mode(), target); } // repeated int32 global_scene_entity_page_ids = 30; @@ -2237,12 +2383,48 @@ ::size_t NSPanelConfig::ByteSizeLong() const { ::_pbi::WireFormatLite::EnumSize(this->_internal_button1_mode()); } - // .NSPanelConfig.NSPanelButtonMode button2_mode = 25; + // .NSPanelConfig.NSPanelButtonFallbackMode button1_fallback_mode = 23; + if (this->_internal_button1_fallback_mode() != 0) { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_button1_fallback_mode()); + } + + // .NSPanelConfig.NSPanelButtonMode button2_mode = 24; if (this->_internal_button2_mode() != 0) { total_size += 2 + ::_pbi::WireFormatLite::EnumSize(this->_internal_button2_mode()); } + // .NSPanelConfig.NSPanelButtonFallbackMode button2_fallback_mode = 25; + if (this->_internal_button2_fallback_mode() != 0) { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_button2_fallback_mode()); + } + + // .NSPanelConfig.NSPanelButtonMode button1_long_mode = 26; + if (this->_internal_button1_long_mode() != 0) { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_button1_long_mode()); + } + + // .NSPanelConfig.NSPanelButtonFallbackMode button1_long_fallback_mode = 27; + if (this->_internal_button1_long_fallback_mode() != 0) { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_button1_long_fallback_mode()); + } + + // .NSPanelConfig.NSPanelButtonMode button2_long_mode = 28; + if (this->_internal_button2_long_mode() != 0) { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_button2_long_mode()); + } + + // .NSPanelConfig.NSPanelButtonFallbackMode button2_long_fallback_mode = 29; + if (this->_internal_button2_long_fallback_mode() != 0) { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_button2_long_fallback_mode()); + } + // int32 raise_light_level_to_100_above = 32; if (this->_internal_raise_light_level_to_100_above() != 0) { total_size += 2 + ::_pbi::WireFormatLite::Int32Size( @@ -2378,9 +2560,27 @@ void NSPanelConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::g if (from._internal_button1_mode() != 0) { _this->_impl_.button1_mode_ = from._impl_.button1_mode_; } + if (from._internal_button1_fallback_mode() != 0) { + _this->_impl_.button1_fallback_mode_ = from._impl_.button1_fallback_mode_; + } if (from._internal_button2_mode() != 0) { _this->_impl_.button2_mode_ = from._impl_.button2_mode_; } + if (from._internal_button2_fallback_mode() != 0) { + _this->_impl_.button2_fallback_mode_ = from._impl_.button2_fallback_mode_; + } + if (from._internal_button1_long_mode() != 0) { + _this->_impl_.button1_long_mode_ = from._impl_.button1_long_mode_; + } + if (from._internal_button1_long_fallback_mode() != 0) { + _this->_impl_.button1_long_fallback_mode_ = from._impl_.button1_long_fallback_mode_; + } + if (from._internal_button2_long_mode() != 0) { + _this->_impl_.button2_long_mode_ = from._impl_.button2_long_mode_; + } + if (from._internal_button2_long_fallback_mode() != 0) { + _this->_impl_.button2_long_fallback_mode_ = from._impl_.button2_long_fallback_mode_; + } if (from._internal_raise_light_level_to_100_above() != 0) { _this->_impl_.raise_light_level_to_100_above_ = from._impl_.raise_light_level_to_100_above_; } @@ -2680,6 +2880,7 @@ inline PROTOBUF_NDEBUG_INLINE NSPanelStatusReport::Impl_::Impl_( md5_firmware_(arena, from.md5_firmware_), md5_littlefs_(arena, from.md5_littlefs_), md5_tft_gui_(arena, from.md5_tft_gui_), + version_(arena, from.version_), _cached_size_{0} {} NSPanelStatusReport::NSPanelStatusReport( @@ -2710,6 +2911,7 @@ inline PROTOBUF_NDEBUG_INLINE NSPanelStatusReport::Impl_::Impl_( md5_firmware_(arena), md5_littlefs_(arena), md5_tft_gui_(arena), + version_(arena), _cached_size_{0} {} inline void NSPanelStatusReport::SharedCtor(::_pb::Arena* arena) { @@ -2733,6 +2935,7 @@ inline void NSPanelStatusReport::SharedDtor() { _impl_.md5_firmware_.Destroy(); _impl_.md5_littlefs_.Destroy(); _impl_.md5_tft_gui_.Destroy(); + _impl_.version_.Destroy(); _impl_.~Impl_(); } @@ -2757,15 +2960,15 @@ NSPanelStatusReport::GetClassData() const { return _data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<4, 11, 1, 92, 2> NSPanelStatusReport::_table_ = { +const ::_pbi::TcParseTable<4, 12, 1, 99, 2> NSPanelStatusReport::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 11, 120, // max_field_number, fast_idx_mask + 12, 120, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294965248, // skipmap + 4294963200, // skipmap offsetof(decltype(_table_), field_entries), - 11, // num_field_entries + 12, // num_field_entries 1, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_NSPanelStatusReport_default_instance_._instance, @@ -2809,7 +3012,9 @@ const ::_pbi::TcParseTable<4, 11, 1, 92, 2> NSPanelStatusReport::_table_ = { // string md5_tft_gui = 11; {::_pbi::TcParser::FastUS1, {90, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelStatusReport, _impl_.md5_tft_gui_)}}, - {::_pbi::TcParser::MiniParse, {}}, + // string version = 12; + {::_pbi::TcParser::FastUS1, + {98, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelStatusReport, _impl_.version_)}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, @@ -2849,16 +3054,20 @@ const ::_pbi::TcParseTable<4, 11, 1, 92, 2> NSPanelStatusReport::_table_ = { // string md5_tft_gui = 11; {PROTOBUF_FIELD_OFFSET(NSPanelStatusReport, _impl_.md5_tft_gui_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string version = 12; + {PROTOBUF_FIELD_OFFSET(NSPanelStatusReport, _impl_.version_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, }}, {{ {::_pbi::TcParser::GetTable<::NSPanelWarning>()}, }}, {{ - "\23\0\0\0\0\13\0\12\0\14\14\13\0\0\0\0" + "\23\0\0\0\0\13\0\12\0\14\14\13\7\0\0\0" "NSPanelStatusReport" "mac_address" "ip_address" "md5_firmware" "md5_littlefs" "md5_tft_gui" + "version" }}, }; @@ -2875,6 +3084,7 @@ PROTOBUF_NOINLINE void NSPanelStatusReport::Clear() { _impl_.md5_firmware_.ClearToEmpty(); _impl_.md5_littlefs_.ClearToEmpty(); _impl_.md5_tft_gui_.ClearToEmpty(); + _impl_.version_.ClearToEmpty(); ::memset(&_impl_.nspanel_state_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.temperature_) - reinterpret_cast(&_impl_.nspanel_state_)) + sizeof(_impl_.temperature_)); @@ -2979,6 +3189,14 @@ ::uint8_t* NSPanelStatusReport::_InternalSerialize( target = stream->WriteStringMaybeAliased(11, _s, target); } + // string version = 12; + if (!this->_internal_version().empty()) { + const std::string& _s = this->_internal_version(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "NSPanelStatusReport.version"); + target = stream->WriteStringMaybeAliased(12, _s, target); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( @@ -3032,6 +3250,12 @@ ::size_t NSPanelStatusReport::ByteSizeLong() const { this->_internal_md5_tft_gui()); } + // string version = 12; + if (!this->_internal_version().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_version()); + } + // .NSPanelStatusReport.state nspanel_state = 1; if (this->_internal_nspanel_state() != 0) { total_size += 1 + @@ -3095,6 +3319,9 @@ void NSPanelStatusReport::MergeImpl(::google::protobuf::MessageLite& to_msg, con if (!from._internal_md5_tft_gui().empty()) { _this->_internal_set_md5_tft_gui(from._internal_md5_tft_gui()); } + if (!from._internal_version().empty()) { + _this->_internal_set_version(from._internal_version()); + } if (from._internal_nspanel_state() != 0) { _this->_impl_.nspanel_state_ = from._impl_.nspanel_state_; } @@ -3137,6 +3364,7 @@ void NSPanelStatusReport::InternalSwap(NSPanelStatusReport* PROTOBUF_RESTRICT ot ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.md5_firmware_, &other->_impl_.md5_firmware_, arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.md5_littlefs_, &other->_impl_.md5_littlefs_, arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.md5_tft_gui_, &other->_impl_.md5_tft_gui_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.version_, &other->_impl_.version_, arena); ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(NSPanelStatusReport, _impl_.temperature_) + sizeof(NSPanelStatusReport::_impl_.temperature_) @@ -6919,6 +7147,178 @@ ::google::protobuf::Metadata NSPanelMQTTManagerCommand_ButtonPressed::GetMetadat } // =================================================================== +class NSPanelMQTTManagerCommand_ButtonLongPressed::_Internal { + public: +}; + +NSPanelMQTTManagerCommand_ButtonLongPressed::NSPanelMQTTManagerCommand_ButtonLongPressed(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:NSPanelMQTTManagerCommand.ButtonLongPressed) +} +NSPanelMQTTManagerCommand_ButtonLongPressed::NSPanelMQTTManagerCommand_ButtonLongPressed( + ::google::protobuf::Arena* arena, const NSPanelMQTTManagerCommand_ButtonLongPressed& from) + : NSPanelMQTTManagerCommand_ButtonLongPressed(arena) { + MergeFrom(from); +} +inline PROTOBUF_NDEBUG_INLINE NSPanelMQTTManagerCommand_ButtonLongPressed::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena) + : _cached_size_{0} {} + +inline void NSPanelMQTTManagerCommand_ButtonLongPressed::SharedCtor(::_pb::Arena* arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.button_id_ = {}; +} +NSPanelMQTTManagerCommand_ButtonLongPressed::~NSPanelMQTTManagerCommand_ButtonLongPressed() { + // @@protoc_insertion_point(destructor:NSPanelMQTTManagerCommand.ButtonLongPressed) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void NSPanelMQTTManagerCommand_ButtonLongPressed::SharedDtor() { + ABSL_DCHECK(GetArena() == nullptr); + _impl_.~Impl_(); +} + +const ::google::protobuf::MessageLite::ClassData* +NSPanelMQTTManagerCommand_ButtonLongPressed::GetClassData() const { + PROTOBUF_CONSTINIT static const ::google::protobuf::MessageLite:: + ClassDataFull _data_ = { + { + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + PROTOBUF_FIELD_OFFSET(NSPanelMQTTManagerCommand_ButtonLongPressed, _impl_._cached_size_), + false, + }, + &NSPanelMQTTManagerCommand_ButtonLongPressed::MergeImpl, + &NSPanelMQTTManagerCommand_ButtonLongPressed::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<0, 1, 0, 0, 2> NSPanelMQTTManagerCommand_ButtonLongPressed::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 2, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967293, // skipmap + offsetof(decltype(_table_), field_entries), + 1, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_NSPanelMQTTManagerCommand_ButtonLongPressed_default_instance_._instance, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::NSPanelMQTTManagerCommand_ButtonLongPressed>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // int32 button_id = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(NSPanelMQTTManagerCommand_ButtonLongPressed, _impl_.button_id_), 63>(), + {16, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelMQTTManagerCommand_ButtonLongPressed, _impl_.button_id_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // int32 button_id = 2; + {PROTOBUF_FIELD_OFFSET(NSPanelMQTTManagerCommand_ButtonLongPressed, _impl_.button_id_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kInt32)}, + }}, + // no aux_entries + {{ + }}, +}; + +PROTOBUF_NOINLINE void NSPanelMQTTManagerCommand_ButtonLongPressed::Clear() { +// @@protoc_insertion_point(message_clear_start:NSPanelMQTTManagerCommand.ButtonLongPressed) + ::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_.button_id_ = 0; + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +::uint8_t* NSPanelMQTTManagerCommand_ButtonLongPressed::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:NSPanelMQTTManagerCommand.ButtonLongPressed) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // int32 button_id = 2; + if (this->_internal_button_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArrayWithField<2>( + stream, this->_internal_button_id(), 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:NSPanelMQTTManagerCommand.ButtonLongPressed) + return target; +} + +::size_t NSPanelMQTTManagerCommand_ButtonLongPressed::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:NSPanelMQTTManagerCommand.ButtonLongPressed) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // int32 button_id = 2; + if (this->_internal_button_id() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this->_internal_button_id()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + + +void NSPanelMQTTManagerCommand_ButtonLongPressed::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:NSPanelMQTTManagerCommand.ButtonLongPressed) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_button_id() != 0) { + _this->_impl_.button_id_ = from._impl_.button_id_; + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void NSPanelMQTTManagerCommand_ButtonLongPressed::CopyFrom(const NSPanelMQTTManagerCommand_ButtonLongPressed& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:NSPanelMQTTManagerCommand.ButtonLongPressed) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void NSPanelMQTTManagerCommand_ButtonLongPressed::InternalSwap(NSPanelMQTTManagerCommand_ButtonLongPressed* PROTOBUF_RESTRICT other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.button_id_, other->_impl_.button_id_); +} + +::google::protobuf::Metadata NSPanelMQTTManagerCommand_ButtonLongPressed::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + class NSPanelMQTTManagerCommand_ThermostatTemperatureCommand::_Internal { public: }; @@ -7473,6 +7873,19 @@ void NSPanelMQTTManagerCommand::set_allocated_button_pressed(::NSPanelMQTTManage } // @@protoc_insertion_point(field_set_allocated:NSPanelMQTTManagerCommand.button_pressed) } +void NSPanelMQTTManagerCommand::set_allocated_button_longpressed(::NSPanelMQTTManagerCommand_ButtonLongPressed* button_longpressed) { + ::google::protobuf::Arena* message_arena = GetArena(); + clear_CommandData(); + if (button_longpressed) { + ::google::protobuf::Arena* submessage_arena = button_longpressed->GetArena(); + if (message_arena != submessage_arena) { + button_longpressed = ::google::protobuf::internal::GetOwnedMessage(message_arena, button_longpressed, submessage_arena); + } + set_has_button_longpressed(); + _impl_.CommandData_.button_longpressed_ = button_longpressed; + } + // @@protoc_insertion_point(field_set_allocated:NSPanelMQTTManagerCommand.button_longpressed) +} void NSPanelMQTTManagerCommand::set_allocated_thermostat_temperature_command(::NSPanelMQTTManagerCommand_ThermostatTemperatureCommand* thermostat_temperature_command) { ::google::protobuf::Arena* message_arena = GetArena(); clear_CommandData(); @@ -7542,6 +7955,9 @@ NSPanelMQTTManagerCommand::NSPanelMQTTManagerCommand( case kButtonPressed: _impl_.CommandData_.button_pressed_ = ::google::protobuf::Message::CopyConstruct<::NSPanelMQTTManagerCommand_ButtonPressed>(arena, *from._impl_.CommandData_.button_pressed_); break; + case kButtonLongpressed: + _impl_.CommandData_.button_longpressed_ = ::google::protobuf::Message::CopyConstruct<::NSPanelMQTTManagerCommand_ButtonLongPressed>(arena, *from._impl_.CommandData_.button_longpressed_); + break; case kThermostatTemperatureCommand: _impl_.CommandData_.thermostat_temperature_command_ = ::google::protobuf::Message::CopyConstruct<::NSPanelMQTTManagerCommand_ThermostatTemperatureCommand>(arena, *from._impl_.CommandData_.thermostat_temperature_command_); break; @@ -7628,6 +8044,14 @@ void NSPanelMQTTManagerCommand::clear_CommandData() { } break; } + case kButtonLongpressed: { + if (GetArena() == nullptr) { + delete _impl_.CommandData_.button_longpressed_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.CommandData_.button_longpressed_); + } + break; + } case kThermostatTemperatureCommand: { if (GetArena() == nullptr) { delete _impl_.CommandData_.thermostat_temperature_command_; @@ -7673,16 +8097,16 @@ NSPanelMQTTManagerCommand::GetClassData() const { return _data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 9, 8, 0, 7> NSPanelMQTTManagerCommand::_table_ = { +const ::_pbi::TcParseTable<0, 10, 9, 0, 7> NSPanelMQTTManagerCommand::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ 100, 0, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967040, // skipmap + 4294966784, // skipmap offsetof(decltype(_table_), field_entries), - 9, // num_field_entries - 8, // num_aux_entries + 10, // num_field_entries + 9, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_NSPanelMQTTManagerCommand_default_instance_._instance, nullptr, // post_loop_handler @@ -7696,7 +8120,7 @@ const ::_pbi::TcParseTable<0, 9, 8, 0, 7> NSPanelMQTTManagerCommand::_table_ = { {1696, 63, 0, PROTOBUF_FIELD_OFFSET(NSPanelMQTTManagerCommand, _impl_.nspanel_id_)}}, }}, {{ 100, 0, 1, - 65534, 8, + 65534, 9, 65535, 65535 }}, {{ // .NSPanelMQTTManagerCommand.FirstPageTurnLightOn first_page_turn_on = 1; @@ -7717,11 +8141,14 @@ const ::_pbi::TcParseTable<0, 9, 8, 0, 7> NSPanelMQTTManagerCommand::_table_ = { // .NSPanelMQTTManagerCommand.ButtonPressed button_pressed = 6; {PROTOBUF_FIELD_OFFSET(NSPanelMQTTManagerCommand, _impl_.CommandData_.button_pressed_), _Internal::kOneofCaseOffset + 0, 5, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .NSPanelMQTTManagerCommand.ThermostatTemperatureCommand thermostat_temperature_command = 7; - {PROTOBUF_FIELD_OFFSET(NSPanelMQTTManagerCommand, _impl_.CommandData_.thermostat_temperature_command_), _Internal::kOneofCaseOffset + 0, 6, + // .NSPanelMQTTManagerCommand.ButtonLongPressed button_longpressed = 7; + {PROTOBUF_FIELD_OFFSET(NSPanelMQTTManagerCommand, _impl_.CommandData_.button_longpressed_), _Internal::kOneofCaseOffset + 0, 6, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, - // .NSPanelMQTTManagerCommand.ThermostatCommand thermostat_command = 8; - {PROTOBUF_FIELD_OFFSET(NSPanelMQTTManagerCommand, _impl_.CommandData_.thermostat_command_), _Internal::kOneofCaseOffset + 0, 7, + // .NSPanelMQTTManagerCommand.ThermostatTemperatureCommand thermostat_temperature_command = 8; + {PROTOBUF_FIELD_OFFSET(NSPanelMQTTManagerCommand, _impl_.CommandData_.thermostat_temperature_command_), _Internal::kOneofCaseOffset + 0, 7, + (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .NSPanelMQTTManagerCommand.ThermostatCommand thermostat_command = 9; + {PROTOBUF_FIELD_OFFSET(NSPanelMQTTManagerCommand, _impl_.CommandData_.thermostat_command_), _Internal::kOneofCaseOffset + 0, 8, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, // int32 nspanel_id = 100; {PROTOBUF_FIELD_OFFSET(NSPanelMQTTManagerCommand, _impl_.nspanel_id_), 0, 0, @@ -7733,6 +8160,7 @@ const ::_pbi::TcParseTable<0, 9, 8, 0, 7> NSPanelMQTTManagerCommand::_table_ = { {::_pbi::TcParser::GetTable<::NSPanelMQTTManagerCommand_ToggleEntityFromEntitiesPage>()}, {::_pbi::TcParser::GetTable<::NSPanelMQTTManagerCommand_SaveSceneCommand>()}, {::_pbi::TcParser::GetTable<::NSPanelMQTTManagerCommand_ButtonPressed>()}, + {::_pbi::TcParser::GetTable<::NSPanelMQTTManagerCommand_ButtonLongPressed>()}, {::_pbi::TcParser::GetTable<::NSPanelMQTTManagerCommand_ThermostatTemperatureCommand>()}, {::_pbi::TcParser::GetTable<::NSPanelMQTTManagerCommand_ThermostatCommand>()}, }}, {{ @@ -7789,14 +8217,19 @@ ::uint8_t* NSPanelMQTTManagerCommand::_InternalSerialize( 6, *_impl_.CommandData_.button_pressed_, _impl_.CommandData_.button_pressed_->GetCachedSize(), target, stream); break; } + case kButtonLongpressed: { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 7, *_impl_.CommandData_.button_longpressed_, _impl_.CommandData_.button_longpressed_->GetCachedSize(), target, stream); + break; + } case kThermostatTemperatureCommand: { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 7, *_impl_.CommandData_.thermostat_temperature_command_, _impl_.CommandData_.thermostat_temperature_command_->GetCachedSize(), target, stream); + 8, *_impl_.CommandData_.thermostat_temperature_command_, _impl_.CommandData_.thermostat_temperature_command_->GetCachedSize(), target, stream); break; } case kThermostatCommand: { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 8, *_impl_.CommandData_.thermostat_command_, _impl_.CommandData_.thermostat_command_->GetCachedSize(), target, stream); + 9, *_impl_.CommandData_.thermostat_command_, _impl_.CommandData_.thermostat_command_->GetCachedSize(), target, stream); break; } default: @@ -7869,13 +8302,19 @@ ::size_t NSPanelMQTTManagerCommand::ByteSizeLong() const { 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.CommandData_.button_pressed_); break; } - // .NSPanelMQTTManagerCommand.ThermostatTemperatureCommand thermostat_temperature_command = 7; + // .NSPanelMQTTManagerCommand.ButtonLongPressed button_longpressed = 7; + case kButtonLongpressed: { + total_size += + 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.CommandData_.button_longpressed_); + break; + } + // .NSPanelMQTTManagerCommand.ThermostatTemperatureCommand thermostat_temperature_command = 8; case kThermostatTemperatureCommand: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.CommandData_.thermostat_temperature_command_); break; } - // .NSPanelMQTTManagerCommand.ThermostatCommand thermostat_command = 8; + // .NSPanelMQTTManagerCommand.ThermostatCommand thermostat_command = 9; case kThermostatCommand: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.CommandData_.thermostat_command_); @@ -7966,6 +8405,15 @@ void NSPanelMQTTManagerCommand::MergeImpl(::google::protobuf::MessageLite& to_ms } break; } + case kButtonLongpressed: { + if (oneof_needs_init) { + _this->_impl_.CommandData_.button_longpressed_ = + ::google::protobuf::Message::CopyConstruct<::NSPanelMQTTManagerCommand_ButtonLongPressed>(arena, *from._impl_.CommandData_.button_longpressed_); + } else { + _this->_impl_.CommandData_.button_longpressed_->MergeFrom(from._internal_button_longpressed()); + } + break; + } case kThermostatTemperatureCommand: { if (oneof_needs_init) { _this->_impl_.CommandData_.thermostat_temperature_command_ = diff --git a/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.h b/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.h index b9680467..0612baec 100644 --- a/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.h +++ b/docker/MQTTManager/include/protobuf/protobuf_nspanel.pb.h @@ -62,6 +62,9 @@ extern NSPanelLightStatusDefaultTypeInternal _NSPanelLightStatus_default_instanc class NSPanelMQTTManagerCommand; struct NSPanelMQTTManagerCommandDefaultTypeInternal; extern NSPanelMQTTManagerCommandDefaultTypeInternal _NSPanelMQTTManagerCommand_default_instance_; +class NSPanelMQTTManagerCommand_ButtonLongPressed; +struct NSPanelMQTTManagerCommand_ButtonLongPressedDefaultTypeInternal; +extern NSPanelMQTTManagerCommand_ButtonLongPressedDefaultTypeInternal _NSPanelMQTTManagerCommand_ButtonLongPressed_default_instance_; class NSPanelMQTTManagerCommand_ButtonPressed; struct NSPanelMQTTManagerCommand_ButtonPressedDefaultTypeInternal; extern NSPanelMQTTManagerCommand_ButtonPressedDefaultTypeInternal _NSPanelMQTTManagerCommand_ButtonPressed_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_NSPanelButtonFallbackMode : int { + NSPanelConfig_NSPanelButtonFallbackMode_DISABLED = 0, + NSPanelConfig_NSPanelButtonFallbackMode_TOGGLE_RELAY1 = 1, + NSPanelConfig_NSPanelButtonFallbackMode_TOGLLE_RELAY2 = 2, + NSPanelConfig_NSPanelButtonFallbackMode_NSPanelConfig_NSPanelButtonFallbackMode_INT_MIN_SENTINEL_DO_NOT_USE_ = + std::numeric_limits<::int32_t>::min(), + NSPanelConfig_NSPanelButtonFallbackMode_NSPanelConfig_NSPanelButtonFallbackMode_INT_MAX_SENTINEL_DO_NOT_USE_ = + std::numeric_limits<::int32_t>::max(), +}; + +bool NSPanelConfig_NSPanelButtonFallbackMode_IsValid(int value); +extern const uint32_t NSPanelConfig_NSPanelButtonFallbackMode_internal_data_[]; +constexpr NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig_NSPanelButtonFallbackMode_NSPanelButtonFallbackMode_MIN = static_cast(0); +constexpr NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig_NSPanelButtonFallbackMode_NSPanelButtonFallbackMode_MAX = static_cast(2); +constexpr int NSPanelConfig_NSPanelButtonFallbackMode_NSPanelButtonFallbackMode_ARRAYSIZE = 2 + 1; +const ::google::protobuf::EnumDescriptor* +NSPanelConfig_NSPanelButtonFallbackMode_descriptor(); +template +const std::string& NSPanelConfig_NSPanelButtonFallbackMode_Name(T value) { + static_assert(std::is_same::value || + std::is_integral::value, + "Incorrect type passed to NSPanelButtonFallbackMode_Name()."); + return NSPanelConfig_NSPanelButtonFallbackMode_Name(static_cast(value)); +} +template <> +inline const std::string& NSPanelConfig_NSPanelButtonFallbackMode_Name(NSPanelConfig_NSPanelButtonFallbackMode value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool NSPanelConfig_NSPanelButtonFallbackMode_Parse(absl::string_view name, NSPanelConfig_NSPanelButtonFallbackMode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + NSPanelConfig_NSPanelButtonFallbackMode_descriptor(), name, value); +} enum NSPanelStatusReport_state : int { NSPanelStatusReport_state_ONLINE = 0, NSPanelStatusReport_state_OFFLINE = 1, @@ -1598,7 +1635,7 @@ class NSPanelMQTTManagerCommand_ThermostatTemperatureCommand final : public ::go return reinterpret_cast( &_NSPanelMQTTManagerCommand_ThermostatTemperatureCommand_default_instance_); } - static constexpr int kIndexInFileMessages = 16; + static constexpr int kIndexInFileMessages = 17; friend void swap(NSPanelMQTTManagerCommand_ThermostatTemperatureCommand& a, NSPanelMQTTManagerCommand_ThermostatTemperatureCommand& b) { a.Swap(&b); } inline void Swap(NSPanelMQTTManagerCommand_ThermostatTemperatureCommand* other) { if (other == this) return; @@ -1781,7 +1818,7 @@ class NSPanelMQTTManagerCommand_ThermostatCommand final : public ::google::proto return reinterpret_cast( &_NSPanelMQTTManagerCommand_ThermostatCommand_default_instance_); } - static constexpr int kIndexInFileMessages = 17; + static constexpr int kIndexInFileMessages = 18; friend void swap(NSPanelMQTTManagerCommand_ThermostatCommand& a, NSPanelMQTTManagerCommand_ThermostatCommand& b) { a.Swap(&b); } inline void Swap(NSPanelMQTTManagerCommand_ThermostatCommand* other) { if (other == this) return; @@ -2989,6 +3026,177 @@ class NSPanelMQTTManagerCommand_ButtonPressed final : public ::google::protobuf: }; // ------------------------------------------------------------------- +class NSPanelMQTTManagerCommand_ButtonLongPressed final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:NSPanelMQTTManagerCommand.ButtonLongPressed) */ { + public: + inline NSPanelMQTTManagerCommand_ButtonLongPressed() : NSPanelMQTTManagerCommand_ButtonLongPressed(nullptr) {} + ~NSPanelMQTTManagerCommand_ButtonLongPressed() override; + template + explicit PROTOBUF_CONSTEXPR NSPanelMQTTManagerCommand_ButtonLongPressed( + ::google::protobuf::internal::ConstantInitialized); + + inline NSPanelMQTTManagerCommand_ButtonLongPressed(const NSPanelMQTTManagerCommand_ButtonLongPressed& from) : NSPanelMQTTManagerCommand_ButtonLongPressed(nullptr, from) {} + inline NSPanelMQTTManagerCommand_ButtonLongPressed(NSPanelMQTTManagerCommand_ButtonLongPressed&& from) noexcept + : NSPanelMQTTManagerCommand_ButtonLongPressed(nullptr, std::move(from)) {} + inline NSPanelMQTTManagerCommand_ButtonLongPressed& operator=(const NSPanelMQTTManagerCommand_ButtonLongPressed& from) { + CopyFrom(from); + return *this; + } + inline NSPanelMQTTManagerCommand_ButtonLongPressed& operator=(NSPanelMQTTManagerCommand_ButtonLongPressed&& 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 NSPanelMQTTManagerCommand_ButtonLongPressed& default_instance() { + return *internal_default_instance(); + } + static inline const NSPanelMQTTManagerCommand_ButtonLongPressed* internal_default_instance() { + return reinterpret_cast( + &_NSPanelMQTTManagerCommand_ButtonLongPressed_default_instance_); + } + static constexpr int kIndexInFileMessages = 16; + friend void swap(NSPanelMQTTManagerCommand_ButtonLongPressed& a, NSPanelMQTTManagerCommand_ButtonLongPressed& b) { a.Swap(&b); } + inline void Swap(NSPanelMQTTManagerCommand_ButtonLongPressed* 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(NSPanelMQTTManagerCommand_ButtonLongPressed* other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + NSPanelMQTTManagerCommand_ButtonLongPressed* New(::google::protobuf::Arena* arena = nullptr) const final { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const NSPanelMQTTManagerCommand_ButtonLongPressed& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const NSPanelMQTTManagerCommand_ButtonLongPressed& from) { NSPanelMQTTManagerCommand_ButtonLongPressed::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(NSPanelMQTTManagerCommand_ButtonLongPressed* other); + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { return "NSPanelMQTTManagerCommand.ButtonLongPressed"; } + + protected: + explicit NSPanelMQTTManagerCommand_ButtonLongPressed(::google::protobuf::Arena* arena); + NSPanelMQTTManagerCommand_ButtonLongPressed(::google::protobuf::Arena* arena, const NSPanelMQTTManagerCommand_ButtonLongPressed& from); + NSPanelMQTTManagerCommand_ButtonLongPressed(::google::protobuf::Arena* arena, NSPanelMQTTManagerCommand_ButtonLongPressed&& from) noexcept + : NSPanelMQTTManagerCommand_ButtonLongPressed(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::Message::ClassData* GetClassData() const final; + + public: + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kButtonIdFieldNumber = 2, + }; + // int32 button_id = 2; + void clear_button_id() ; + ::int32_t button_id() const; + void set_button_id(::int32_t value); + + private: + ::int32_t _internal_button_id() const; + void _internal_set_button_id(::int32_t value); + + public: + // @@protoc_insertion_point(class_scope:NSPanelMQTTManagerCommand.ButtonLongPressed) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable< + 0, 1, 0, + 0, 2> + _table_; + + static constexpr const void* _raw_default_instance_ = + &_NSPanelMQTTManagerCommand_ButtonLongPressed_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 NSPanelMQTTManagerCommand_ButtonLongPressed& from_msg); + ::int32_t button_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_protobuf_5fnspanel_2eproto; +}; +// ------------------------------------------------------------------- + class NSPanelLightStatus final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:NSPanelLightStatus) */ { public: @@ -3944,6 +4152,7 @@ class NSPanelStatusReport final : public ::google::protobuf::Message kMd5FirmwareFieldNumber = 9, kMd5LittlefsFieldNumber = 10, kMd5TftGuiFieldNumber = 11, + kVersionFieldNumber = 12, kNspanelStateFieldNumber = 1, kUpdateProgressFieldNumber = 2, kRssiFieldNumber = 3, @@ -4046,6 +4255,22 @@ class NSPanelStatusReport final : public ::google::protobuf::Message const std::string& value); std::string* _internal_mutable_md5_tft_gui(); + public: + // string version = 12; + void clear_version() ; + const std::string& version() const; + template + void set_version(Arg_&& arg, Args_... args); + std::string* mutable_version(); + PROTOBUF_NODISCARD std::string* release_version(); + void set_allocated_version(std::string* value); + + private: + const std::string& _internal_version() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_version( + const std::string& value); + std::string* _internal_mutable_version(); + public: // .NSPanelStatusReport.state nspanel_state = 1; void clear_nspanel_state() ; @@ -4102,8 +4327,8 @@ class NSPanelStatusReport final : public ::google::protobuf::Message class _Internal; friend class ::google::protobuf::internal::TcParser; static const ::google::protobuf::internal::TcParseTable< - 4, 11, 1, - 92, 2> + 4, 12, 1, + 99, 2> _table_; static constexpr const void* _raw_default_instance_ = @@ -4129,6 +4354,7 @@ class NSPanelStatusReport final : public ::google::protobuf::Message ::google::protobuf::internal::ArenaStringPtr md5_firmware_; ::google::protobuf::internal::ArenaStringPtr md5_littlefs_; ::google::protobuf::internal::ArenaStringPtr md5_tft_gui_; + ::google::protobuf::internal::ArenaStringPtr version_; int nspanel_state_; ::int32_t update_progress_; ::int32_t rssi_; @@ -4421,15 +4647,16 @@ class NSPanelMQTTManagerCommand final : public ::google::protobuf::Message kToggleEntityFromEntitiesPage = 4, kSaveSceneCommand = 5, kButtonPressed = 6, - kThermostatTemperatureCommand = 7, - kThermostatCommand = 8, + kButtonLongpressed = 7, + kThermostatTemperatureCommand = 8, + kThermostatCommand = 9, COMMANDDATA_NOT_SET = 0, }; static inline const NSPanelMQTTManagerCommand* internal_default_instance() { 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; @@ -4501,6 +4728,7 @@ class NSPanelMQTTManagerCommand final : public ::google::protobuf::Message using ToggleEntityFromEntitiesPage = NSPanelMQTTManagerCommand_ToggleEntityFromEntitiesPage; using SaveSceneCommand = NSPanelMQTTManagerCommand_SaveSceneCommand; using ButtonPressed = NSPanelMQTTManagerCommand_ButtonPressed; + using ButtonLongPressed = NSPanelMQTTManagerCommand_ButtonLongPressed; using ThermostatTemperatureCommand = NSPanelMQTTManagerCommand_ThermostatTemperatureCommand; using ThermostatCommand = NSPanelMQTTManagerCommand_ThermostatCommand; using AffectLightsOptions = NSPanelMQTTManagerCommand_AffectLightsOptions; @@ -4533,8 +4761,9 @@ class NSPanelMQTTManagerCommand final : public ::google::protobuf::Message kToggleEntityFromEntitiesPageFieldNumber = 4, kSaveSceneCommandFieldNumber = 5, kButtonPressedFieldNumber = 6, - kThermostatTemperatureCommandFieldNumber = 7, - kThermostatCommandFieldNumber = 8, + kButtonLongpressedFieldNumber = 7, + kThermostatTemperatureCommandFieldNumber = 8, + kThermostatCommandFieldNumber = 9, }; // int32 nspanel_id = 100; void clear_nspanel_id() ; @@ -4660,7 +4889,26 @@ class NSPanelMQTTManagerCommand final : public ::google::protobuf::Message ::NSPanelMQTTManagerCommand_ButtonPressed* _internal_mutable_button_pressed(); public: - // .NSPanelMQTTManagerCommand.ThermostatTemperatureCommand thermostat_temperature_command = 7; + // .NSPanelMQTTManagerCommand.ButtonLongPressed button_longpressed = 7; + bool has_button_longpressed() const; + private: + bool _internal_has_button_longpressed() const; + + public: + void clear_button_longpressed() ; + const ::NSPanelMQTTManagerCommand_ButtonLongPressed& button_longpressed() const; + PROTOBUF_NODISCARD ::NSPanelMQTTManagerCommand_ButtonLongPressed* release_button_longpressed(); + ::NSPanelMQTTManagerCommand_ButtonLongPressed* mutable_button_longpressed(); + void set_allocated_button_longpressed(::NSPanelMQTTManagerCommand_ButtonLongPressed* value); + void unsafe_arena_set_allocated_button_longpressed(::NSPanelMQTTManagerCommand_ButtonLongPressed* value); + ::NSPanelMQTTManagerCommand_ButtonLongPressed* unsafe_arena_release_button_longpressed(); + + private: + const ::NSPanelMQTTManagerCommand_ButtonLongPressed& _internal_button_longpressed() const; + ::NSPanelMQTTManagerCommand_ButtonLongPressed* _internal_mutable_button_longpressed(); + + public: + // .NSPanelMQTTManagerCommand.ThermostatTemperatureCommand thermostat_temperature_command = 8; bool has_thermostat_temperature_command() const; private: bool _internal_has_thermostat_temperature_command() const; @@ -4679,7 +4927,7 @@ class NSPanelMQTTManagerCommand final : public ::google::protobuf::Message ::NSPanelMQTTManagerCommand_ThermostatTemperatureCommand* _internal_mutable_thermostat_temperature_command(); public: - // .NSPanelMQTTManagerCommand.ThermostatCommand thermostat_command = 8; + // .NSPanelMQTTManagerCommand.ThermostatCommand thermostat_command = 9; bool has_thermostat_command() const; private: bool _internal_has_thermostat_command() const; @@ -4709,13 +4957,14 @@ class NSPanelMQTTManagerCommand final : public ::google::protobuf::Message void set_has_toggle_entity_from_entities_page(); void set_has_save_scene_command(); void set_has_button_pressed(); + void set_has_button_longpressed(); void set_has_thermostat_temperature_command(); void set_has_thermostat_command(); inline bool has_CommandData() const; inline void clear_has_CommandData(); friend class ::google::protobuf::internal::TcParser; static const ::google::protobuf::internal::TcParseTable< - 0, 9, 8, + 0, 10, 9, 0, 7> _table_; @@ -4746,6 +4995,7 @@ class NSPanelMQTTManagerCommand final : public ::google::protobuf::Message ::NSPanelMQTTManagerCommand_ToggleEntityFromEntitiesPage* toggle_entity_from_entities_page_; ::NSPanelMQTTManagerCommand_SaveSceneCommand* save_scene_command_; ::NSPanelMQTTManagerCommand_ButtonPressed* button_pressed_; + ::NSPanelMQTTManagerCommand_ButtonLongPressed* button_longpressed_; ::NSPanelMQTTManagerCommand_ThermostatTemperatureCommand* thermostat_temperature_command_; ::NSPanelMQTTManagerCommand_ThermostatCommand* thermostat_command_; } CommandData_; @@ -4944,6 +5194,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 NSPanelButtonFallbackMode = NSPanelConfig_NSPanelButtonFallbackMode; + static constexpr NSPanelButtonFallbackMode DISABLED = NSPanelConfig_NSPanelButtonFallbackMode_DISABLED; + static constexpr NSPanelButtonFallbackMode TOGGLE_RELAY1 = NSPanelConfig_NSPanelButtonFallbackMode_TOGGLE_RELAY1; + static constexpr NSPanelButtonFallbackMode TOGLLE_RELAY2 = NSPanelConfig_NSPanelButtonFallbackMode_TOGLLE_RELAY2; + static inline bool NSPanelButtonFallbackMode_IsValid(int value) { + return NSPanelConfig_NSPanelButtonFallbackMode_IsValid(value); + } + static constexpr NSPanelButtonFallbackMode NSPanelButtonFallbackMode_MIN = NSPanelConfig_NSPanelButtonFallbackMode_NSPanelButtonFallbackMode_MIN; + static constexpr NSPanelButtonFallbackMode NSPanelButtonFallbackMode_MAX = NSPanelConfig_NSPanelButtonFallbackMode_NSPanelButtonFallbackMode_MAX; + static constexpr int NSPanelButtonFallbackMode_ARRAYSIZE = NSPanelConfig_NSPanelButtonFallbackMode_NSPanelButtonFallbackMode_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* NSPanelButtonFallbackMode_descriptor() { + return NSPanelConfig_NSPanelButtonFallbackMode_descriptor(); + } + template + static inline const std::string& NSPanelButtonFallbackMode_Name(T value) { + return NSPanelConfig_NSPanelButtonFallbackMode_Name(value); + } + static inline bool NSPanelButtonFallbackMode_Parse(absl::string_view name, NSPanelButtonFallbackMode* value) { + return NSPanelConfig_NSPanelButtonFallbackMode_Parse(name, value); + } // accessors ------------------------------------------------------- enum : int { @@ -4973,7 +5243,13 @@ class NSPanelConfig final : public ::google::protobuf::Message kRelay2DefaultModeFieldNumber = 20, kTemperatureCalibrationFieldNumber = 21, kButton1ModeFieldNumber = 22, - kButton2ModeFieldNumber = 25, + kButton1FallbackModeFieldNumber = 23, + kButton2ModeFieldNumber = 24, + kButton2FallbackModeFieldNumber = 25, + kButton1LongModeFieldNumber = 26, + kButton1LongFallbackModeFieldNumber = 27, + kButton2LongModeFieldNumber = 28, + kButton2LongFallbackModeFieldNumber = 29, kRaiseLightLevelTo100AboveFieldNumber = 32, kNspanelIdFieldNumber = 33, kOptimisticModeFieldNumber = 31, @@ -5287,7 +5563,17 @@ class NSPanelConfig final : public ::google::protobuf::Message void _internal_set_button1_mode(::NSPanelConfig_NSPanelButtonMode value); public: - // .NSPanelConfig.NSPanelButtonMode button2_mode = 25; + // .NSPanelConfig.NSPanelButtonFallbackMode button1_fallback_mode = 23; + void clear_button1_fallback_mode() ; + ::NSPanelConfig_NSPanelButtonFallbackMode button1_fallback_mode() const; + void set_button1_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value); + + private: + ::NSPanelConfig_NSPanelButtonFallbackMode _internal_button1_fallback_mode() const; + void _internal_set_button1_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value); + + public: + // .NSPanelConfig.NSPanelButtonMode button2_mode = 24; void clear_button2_mode() ; ::NSPanelConfig_NSPanelButtonMode button2_mode() const; void set_button2_mode(::NSPanelConfig_NSPanelButtonMode value); @@ -5296,6 +5582,56 @@ class NSPanelConfig final : public ::google::protobuf::Message ::NSPanelConfig_NSPanelButtonMode _internal_button2_mode() const; void _internal_set_button2_mode(::NSPanelConfig_NSPanelButtonMode value); + public: + // .NSPanelConfig.NSPanelButtonFallbackMode button2_fallback_mode = 25; + void clear_button2_fallback_mode() ; + ::NSPanelConfig_NSPanelButtonFallbackMode button2_fallback_mode() const; + void set_button2_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value); + + private: + ::NSPanelConfig_NSPanelButtonFallbackMode _internal_button2_fallback_mode() const; + void _internal_set_button2_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value); + + public: + // .NSPanelConfig.NSPanelButtonMode button1_long_mode = 26; + void clear_button1_long_mode() ; + ::NSPanelConfig_NSPanelButtonMode button1_long_mode() const; + void set_button1_long_mode(::NSPanelConfig_NSPanelButtonMode value); + + private: + ::NSPanelConfig_NSPanelButtonMode _internal_button1_long_mode() const; + void _internal_set_button1_long_mode(::NSPanelConfig_NSPanelButtonMode value); + + public: + // .NSPanelConfig.NSPanelButtonFallbackMode button1_long_fallback_mode = 27; + void clear_button1_long_fallback_mode() ; + ::NSPanelConfig_NSPanelButtonFallbackMode button1_long_fallback_mode() const; + void set_button1_long_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value); + + private: + ::NSPanelConfig_NSPanelButtonFallbackMode _internal_button1_long_fallback_mode() const; + void _internal_set_button1_long_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value); + + public: + // .NSPanelConfig.NSPanelButtonMode button2_long_mode = 28; + void clear_button2_long_mode() ; + ::NSPanelConfig_NSPanelButtonMode button2_long_mode() const; + void set_button2_long_mode(::NSPanelConfig_NSPanelButtonMode value); + + private: + ::NSPanelConfig_NSPanelButtonMode _internal_button2_long_mode() const; + void _internal_set_button2_long_mode(::NSPanelConfig_NSPanelButtonMode value); + + public: + // .NSPanelConfig.NSPanelButtonFallbackMode button2_long_fallback_mode = 29; + void clear_button2_long_fallback_mode() ; + ::NSPanelConfig_NSPanelButtonFallbackMode button2_long_fallback_mode() const; + void set_button2_long_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value); + + private: + ::NSPanelConfig_NSPanelButtonFallbackMode _internal_button2_long_fallback_mode() const; + void _internal_set_button2_long_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value); + public: // int32 raise_light_level_to_100_above = 32; void clear_raise_light_level_to_100_above() ; @@ -5392,8 +5728,8 @@ class NSPanelConfig final : public ::google::protobuf::Message class _Internal; friend class ::google::protobuf::internal::TcParser; static const ::google::protobuf::internal::TcParseTable< - 5, 36, 1, - 94, 7> + 5, 42, 1, + 102, 7> _table_; static constexpr const void* _raw_default_instance_ = @@ -5442,7 +5778,13 @@ class NSPanelConfig final : public ::google::protobuf::Message bool relay2_default_mode_; ::int32_t temperature_calibration_; int button1_mode_; + int button1_fallback_mode_; int button2_mode_; + int button2_fallback_mode_; + int button1_long_mode_; + int button1_long_fallback_mode_; + int button2_long_mode_; + int button2_long_fallback_mode_; ::int32_t raise_light_level_to_100_above_; ::int32_t nspanel_id_; bool optimistic_mode_; @@ -6130,7 +6472,29 @@ inline void NSPanelConfig::_internal_set_button1_mode(::NSPanelConfig_NSPanelBut _impl_.button1_mode_ = value; } -// .NSPanelConfig.NSPanelButtonMode button2_mode = 25; +// .NSPanelConfig.NSPanelButtonFallbackMode button1_fallback_mode = 23; +inline void NSPanelConfig::clear_button1_fallback_mode() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_fallback_mode_ = 0; +} +inline ::NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig::button1_fallback_mode() const { + // @@protoc_insertion_point(field_get:NSPanelConfig.button1_fallback_mode) + return _internal_button1_fallback_mode(); +} +inline void NSPanelConfig::set_button1_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value) { + _internal_set_button1_fallback_mode(value); + // @@protoc_insertion_point(field_set:NSPanelConfig.button1_fallback_mode) +} +inline ::NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig::_internal_button1_fallback_mode() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::NSPanelConfig_NSPanelButtonFallbackMode>(_impl_.button1_fallback_mode_); +} +inline void NSPanelConfig::_internal_set_button1_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_fallback_mode_ = value; +} + +// .NSPanelConfig.NSPanelButtonMode button2_mode = 24; inline void NSPanelConfig::clear_button2_mode() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.button2_mode_ = 0; @@ -6152,6 +6516,116 @@ inline void NSPanelConfig::_internal_set_button2_mode(::NSPanelConfig_NSPanelBut _impl_.button2_mode_ = value; } +// .NSPanelConfig.NSPanelButtonFallbackMode button2_fallback_mode = 25; +inline void NSPanelConfig::clear_button2_fallback_mode() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_fallback_mode_ = 0; +} +inline ::NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig::button2_fallback_mode() const { + // @@protoc_insertion_point(field_get:NSPanelConfig.button2_fallback_mode) + return _internal_button2_fallback_mode(); +} +inline void NSPanelConfig::set_button2_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value) { + _internal_set_button2_fallback_mode(value); + // @@protoc_insertion_point(field_set:NSPanelConfig.button2_fallback_mode) +} +inline ::NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig::_internal_button2_fallback_mode() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::NSPanelConfig_NSPanelButtonFallbackMode>(_impl_.button2_fallback_mode_); +} +inline void NSPanelConfig::_internal_set_button2_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_fallback_mode_ = value; +} + +// .NSPanelConfig.NSPanelButtonMode button1_long_mode = 26; +inline void NSPanelConfig::clear_button1_long_mode() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_long_mode_ = 0; +} +inline ::NSPanelConfig_NSPanelButtonMode NSPanelConfig::button1_long_mode() const { + // @@protoc_insertion_point(field_get:NSPanelConfig.button1_long_mode) + return _internal_button1_long_mode(); +} +inline void NSPanelConfig::set_button1_long_mode(::NSPanelConfig_NSPanelButtonMode value) { + _internal_set_button1_long_mode(value); + // @@protoc_insertion_point(field_set:NSPanelConfig.button1_long_mode) +} +inline ::NSPanelConfig_NSPanelButtonMode NSPanelConfig::_internal_button1_long_mode() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::NSPanelConfig_NSPanelButtonMode>(_impl_.button1_long_mode_); +} +inline void NSPanelConfig::_internal_set_button1_long_mode(::NSPanelConfig_NSPanelButtonMode value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_long_mode_ = value; +} + +// .NSPanelConfig.NSPanelButtonFallbackMode button1_long_fallback_mode = 27; +inline void NSPanelConfig::clear_button1_long_fallback_mode() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_long_fallback_mode_ = 0; +} +inline ::NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig::button1_long_fallback_mode() const { + // @@protoc_insertion_point(field_get:NSPanelConfig.button1_long_fallback_mode) + return _internal_button1_long_fallback_mode(); +} +inline void NSPanelConfig::set_button1_long_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value) { + _internal_set_button1_long_fallback_mode(value); + // @@protoc_insertion_point(field_set:NSPanelConfig.button1_long_fallback_mode) +} +inline ::NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig::_internal_button1_long_fallback_mode() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::NSPanelConfig_NSPanelButtonFallbackMode>(_impl_.button1_long_fallback_mode_); +} +inline void NSPanelConfig::_internal_set_button1_long_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button1_long_fallback_mode_ = value; +} + +// .NSPanelConfig.NSPanelButtonMode button2_long_mode = 28; +inline void NSPanelConfig::clear_button2_long_mode() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_long_mode_ = 0; +} +inline ::NSPanelConfig_NSPanelButtonMode NSPanelConfig::button2_long_mode() const { + // @@protoc_insertion_point(field_get:NSPanelConfig.button2_long_mode) + return _internal_button2_long_mode(); +} +inline void NSPanelConfig::set_button2_long_mode(::NSPanelConfig_NSPanelButtonMode value) { + _internal_set_button2_long_mode(value); + // @@protoc_insertion_point(field_set:NSPanelConfig.button2_long_mode) +} +inline ::NSPanelConfig_NSPanelButtonMode NSPanelConfig::_internal_button2_long_mode() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::NSPanelConfig_NSPanelButtonMode>(_impl_.button2_long_mode_); +} +inline void NSPanelConfig::_internal_set_button2_long_mode(::NSPanelConfig_NSPanelButtonMode value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_long_mode_ = value; +} + +// .NSPanelConfig.NSPanelButtonFallbackMode button2_long_fallback_mode = 29; +inline void NSPanelConfig::clear_button2_long_fallback_mode() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_long_fallback_mode_ = 0; +} +inline ::NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig::button2_long_fallback_mode() const { + // @@protoc_insertion_point(field_get:NSPanelConfig.button2_long_fallback_mode) + return _internal_button2_long_fallback_mode(); +} +inline void NSPanelConfig::set_button2_long_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value) { + _internal_set_button2_long_fallback_mode(value); + // @@protoc_insertion_point(field_set:NSPanelConfig.button2_long_fallback_mode) +} +inline ::NSPanelConfig_NSPanelButtonFallbackMode NSPanelConfig::_internal_button2_long_fallback_mode() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::NSPanelConfig_NSPanelButtonFallbackMode>(_impl_.button2_long_fallback_mode_); +} +inline void NSPanelConfig::_internal_set_button2_long_fallback_mode(::NSPanelConfig_NSPanelButtonFallbackMode value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button2_long_fallback_mode_ = value; +} + // repeated int32 global_scene_entity_page_ids = 30; inline int NSPanelConfig::_internal_global_scene_entity_page_ids_size() const { return _internal_global_scene_entity_page_ids().size(); @@ -7024,6 +7498,56 @@ inline void NSPanelStatusReport::set_allocated_md5_tft_gui(std::string* value) { // @@protoc_insertion_point(field_set_allocated:NSPanelStatusReport.md5_tft_gui) } +// string version = 12; +inline void NSPanelStatusReport::clear_version() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.version_.ClearToEmpty(); +} +inline const std::string& NSPanelStatusReport::version() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:NSPanelStatusReport.version) + return _internal_version(); +} +template +inline PROTOBUF_ALWAYS_INLINE void NSPanelStatusReport::set_version(Arg_&& arg, + Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.version_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:NSPanelStatusReport.version) +} +inline std::string* NSPanelStatusReport::mutable_version() ABSL_ATTRIBUTE_LIFETIME_BOUND { + std::string* _s = _internal_mutable_version(); + // @@protoc_insertion_point(field_mutable:NSPanelStatusReport.version) + return _s; +} +inline const std::string& NSPanelStatusReport::_internal_version() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.version_.Get(); +} +inline void NSPanelStatusReport::_internal_set_version(const std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.version_.Set(value, GetArena()); +} +inline std::string* NSPanelStatusReport::_internal_mutable_version() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.version_.Mutable( GetArena()); +} +inline std::string* NSPanelStatusReport::release_version() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:NSPanelStatusReport.version) + return _impl_.version_.Release(); +} +inline void NSPanelStatusReport::set_allocated_version(std::string* value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.version_.SetAllocated(value, GetArena()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.version_.IsDefault()) { + _impl_.version_.Set("", GetArena()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:NSPanelStatusReport.version) +} + // ------------------------------------------------------------------- // NSPanelLightStatus @@ -9218,6 +9742,32 @@ inline void NSPanelMQTTManagerCommand_ButtonPressed::_internal_set_button_id(::i // ------------------------------------------------------------------- +// NSPanelMQTTManagerCommand_ButtonLongPressed + +// int32 button_id = 2; +inline void NSPanelMQTTManagerCommand_ButtonLongPressed::clear_button_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button_id_ = 0; +} +inline ::int32_t NSPanelMQTTManagerCommand_ButtonLongPressed::button_id() const { + // @@protoc_insertion_point(field_get:NSPanelMQTTManagerCommand.ButtonLongPressed.button_id) + return _internal_button_id(); +} +inline void NSPanelMQTTManagerCommand_ButtonLongPressed::set_button_id(::int32_t value) { + _internal_set_button_id(value); + // @@protoc_insertion_point(field_set:NSPanelMQTTManagerCommand.ButtonLongPressed.button_id) +} +inline ::int32_t NSPanelMQTTManagerCommand_ButtonLongPressed::_internal_button_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.button_id_; +} +inline void NSPanelMQTTManagerCommand_ButtonLongPressed::_internal_set_button_id(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.button_id_ = value; +} + +// ------------------------------------------------------------------- + // NSPanelMQTTManagerCommand_ThermostatTemperatureCommand // int32 thermostat_id = 1; @@ -9868,7 +10418,86 @@ inline ::NSPanelMQTTManagerCommand_ButtonPressed* NSPanelMQTTManagerCommand::mut return _msg; } -// .NSPanelMQTTManagerCommand.ThermostatTemperatureCommand thermostat_temperature_command = 7; +// .NSPanelMQTTManagerCommand.ButtonLongPressed button_longpressed = 7; +inline bool NSPanelMQTTManagerCommand::has_button_longpressed() const { + return CommandData_case() == kButtonLongpressed; +} +inline bool NSPanelMQTTManagerCommand::_internal_has_button_longpressed() const { + return CommandData_case() == kButtonLongpressed; +} +inline void NSPanelMQTTManagerCommand::set_has_button_longpressed() { + _impl_._oneof_case_[0] = kButtonLongpressed; +} +inline void NSPanelMQTTManagerCommand::clear_button_longpressed() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (CommandData_case() == kButtonLongpressed) { + if (GetArena() == nullptr) { + delete _impl_.CommandData_.button_longpressed_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.CommandData_.button_longpressed_); + } + clear_has_CommandData(); + } +} +inline ::NSPanelMQTTManagerCommand_ButtonLongPressed* NSPanelMQTTManagerCommand::release_button_longpressed() { + // @@protoc_insertion_point(field_release:NSPanelMQTTManagerCommand.button_longpressed) + if (CommandData_case() == kButtonLongpressed) { + clear_has_CommandData(); + auto* temp = _impl_.CommandData_.button_longpressed_; + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.CommandData_.button_longpressed_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::NSPanelMQTTManagerCommand_ButtonLongPressed& NSPanelMQTTManagerCommand::_internal_button_longpressed() const { + return CommandData_case() == kButtonLongpressed ? *_impl_.CommandData_.button_longpressed_ : reinterpret_cast<::NSPanelMQTTManagerCommand_ButtonLongPressed&>(::_NSPanelMQTTManagerCommand_ButtonLongPressed_default_instance_); +} +inline const ::NSPanelMQTTManagerCommand_ButtonLongPressed& NSPanelMQTTManagerCommand::button_longpressed() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:NSPanelMQTTManagerCommand.button_longpressed) + return _internal_button_longpressed(); +} +inline ::NSPanelMQTTManagerCommand_ButtonLongPressed* NSPanelMQTTManagerCommand::unsafe_arena_release_button_longpressed() { + // @@protoc_insertion_point(field_unsafe_arena_release:NSPanelMQTTManagerCommand.button_longpressed) + if (CommandData_case() == kButtonLongpressed) { + clear_has_CommandData(); + auto* temp = _impl_.CommandData_.button_longpressed_; + _impl_.CommandData_.button_longpressed_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void NSPanelMQTTManagerCommand::unsafe_arena_set_allocated_button_longpressed(::NSPanelMQTTManagerCommand_ButtonLongPressed* value) { + // We rely on the oneof clear method to free the earlier contents + // of this oneof. We can directly use the pointer we're given to + // set the new value. + clear_CommandData(); + if (value) { + set_has_button_longpressed(); + _impl_.CommandData_.button_longpressed_ = value; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:NSPanelMQTTManagerCommand.button_longpressed) +} +inline ::NSPanelMQTTManagerCommand_ButtonLongPressed* NSPanelMQTTManagerCommand::_internal_mutable_button_longpressed() { + if (CommandData_case() != kButtonLongpressed) { + clear_CommandData(); + set_has_button_longpressed(); + _impl_.CommandData_.button_longpressed_ = + ::google::protobuf::Message::DefaultConstruct<::NSPanelMQTTManagerCommand_ButtonLongPressed>(GetArena()); + } + return _impl_.CommandData_.button_longpressed_; +} +inline ::NSPanelMQTTManagerCommand_ButtonLongPressed* NSPanelMQTTManagerCommand::mutable_button_longpressed() ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::NSPanelMQTTManagerCommand_ButtonLongPressed* _msg = _internal_mutable_button_longpressed(); + // @@protoc_insertion_point(field_mutable:NSPanelMQTTManagerCommand.button_longpressed) + return _msg; +} + +// .NSPanelMQTTManagerCommand.ThermostatTemperatureCommand thermostat_temperature_command = 8; inline bool NSPanelMQTTManagerCommand::has_thermostat_temperature_command() const { return CommandData_case() == kThermostatTemperatureCommand; } @@ -9947,7 +10576,7 @@ inline ::NSPanelMQTTManagerCommand_ThermostatTemperatureCommand* NSPanelMQTTMana return _msg; } -// .NSPanelMQTTManagerCommand.ThermostatCommand thermostat_command = 8; +// .NSPanelMQTTManagerCommand.ThermostatCommand thermostat_command = 9; inline bool NSPanelMQTTManagerCommand::has_thermostat_command() const { return CommandData_case() == kThermostatCommand; } @@ -10086,6 +10715,12 @@ inline const EnumDescriptor* GetEnumDescriptor<::NSPanelConfig_NSPanelButtonMode return ::NSPanelConfig_NSPanelButtonMode_descriptor(); } template <> +struct is_proto_enum<::NSPanelConfig_NSPanelButtonFallbackMode> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::NSPanelConfig_NSPanelButtonFallbackMode>() { + return ::NSPanelConfig_NSPanelButtonFallbackMode_descriptor(); +} +template <> struct is_proto_enum<::NSPanelStatusReport_state> : std::true_type {}; template <> inline const EnumDescriptor* GetEnumDescriptor<::NSPanelStatusReport_state>() { diff --git a/docker/protobuf/protobuf_mqttmanager.proto b/docker/protobuf/protobuf_mqttmanager.proto index f3f4c477..869159b2 100644 --- a/docker/protobuf/protobuf_mqttmanager.proto +++ b/docker/protobuf/protobuf_mqttmanager.proto @@ -50,30 +50,49 @@ message NSPanelSettings { CUSTOM_MQTT = 2; FOLLOW_MODE = 3; } - NSPanelButtonMode button1_mode = 27; - NSPanelButtonMode button2_mode = 28; + enum NSPanelButtonFallbackMode { + DISABLED=0; + TOGGLE_RELAY1 = 1; + TOGLLE_RELAY2 = 2; + } + NSPanelButtonMode button1_mode = 30; + NSPanelButtonFallbackMode button1_fallback = 31; + NSPanelButtonMode button2_mode = 32; + NSPanelButtonFallbackMode button2_fallback = 33; + + NSPanelButtonMode button1_long_mode = 34; + NSPanelButtonFallbackMode button1_long_fallback = 35; + NSPanelButtonMode button2_long_mode = 36; + NSPanelButtonFallbackMode button2_long_fallback = 37; + + optional string button1_mqtt_topic = 38; + optional string button2_mqtt_topic = 39; + optional string button1_mqtt_payload = 40; + optional string button2_mqtt_payload = 41; + optional int32 button1_detached_light_id = 42; + optional int32 button2_detached_light_id = 43; - optional string button1_mqtt_topic = 29; - optional string button2_mqtt_topic = 30; - optional string button1_mqtt_payload = 31; - optional string button2_mqtt_payload = 32; - optional int32 button1_detached_light_id = 33; - optional int32 button2_detached_light_id = 34; + optional string button1_long_mqtt_topic = 44; + optional string button2_long_mqtt_topic = 45; + optional string button1_long_mqtt_payload = 46; + optional string button2_long_mqtt_payload = 47; + optional int32 button1_long_detached_light_id = 48; + optional int32 button2_long_detached_light_id = 49; - bool denied = 45; - bool accepted = 46; - repeated int32 rooms = 47; - repeated int32 scenes = 48; - string ip_address = 49; + bool denied = 50; + bool accepted = 51; + repeated int32 rooms = 52; + repeated int32 scenes = 53; + string ip_address = 54; enum RelayRegisterType { SWITCH = 0; LIGHT = 1; } - RelayRegisterType relay1_register_type = 50; - RelayRegisterType relay2_register_type = 51; + RelayRegisterType relay1_register_type = 55; + RelayRegisterType relay2_register_type = 56; - int32 default_room = 52; + int32 default_room = 57; } message MultipleNSPanelsSettings { diff --git a/docker/protobuf/protobuf_nspanel.proto b/docker/protobuf/protobuf_nspanel.proto index 69b587ba..fd49db23 100644 --- a/docker/protobuf/protobuf_nspanel.proto +++ b/docker/protobuf/protobuf_nspanel.proto @@ -55,8 +55,22 @@ message NSPanelConfig { THERMOSTAT_HEAT = 3; THERMOSTAT_COOL = 4; }; + + enum NSPanelButtonFallbackMode { + DISABLED=0; + TOGGLE_RELAY1 = 1; + TOGLLE_RELAY2 = 2; + } + NSPanelButtonMode button1_mode = 22; - NSPanelButtonMode button2_mode = 25; + NSPanelButtonFallbackMode button1_fallback_mode = 23; + NSPanelButtonMode button2_mode = 24; + NSPanelButtonFallbackMode button2_fallback_mode = 25; + + NSPanelButtonMode button1_long_mode = 26; + NSPanelButtonFallbackMode button1_long_fallback_mode = 27; + NSPanelButtonMode button2_long_mode = 28; + NSPanelButtonFallbackMode button2_long_fallback_mode = 29; repeated int32 global_scene_entity_page_ids = 30; bool optimistic_mode = 31; @@ -113,6 +127,7 @@ message NSPanelStatusReport { string md5_firmware = 9; string md5_littlefs = 10; string md5_tft_gui = 11; + string version = 12; } message NSPanelLightStatus { @@ -235,6 +250,10 @@ message NSPanelMQTTManagerCommand { int32 button_id = 2; } + message ButtonLongPressed { + int32 button_id = 2; + } + message ThermostatTemperatureCommand { int32 thermostat_id = 1; float temperature = 2; @@ -253,9 +272,10 @@ message NSPanelMQTTManagerCommand { ToggleEntityFromEntitiesPage toggle_entity_from_entities_page = 4; SaveSceneCommand save_scene_command = 5; ButtonPressed button_pressed = 6; + ButtonLongPressed button_longpressed = 7; - ThermostatTemperatureCommand thermostat_temperature_command = 7; - ThermostatCommand thermostat_command = 8; + ThermostatTemperatureCommand thermostat_temperature_command = 8; + ThermostatCommand thermostat_command = 9; } diff --git a/docker/web/nspanelmanager/web/api.py b/docker/web/nspanelmanager/web/api.py index a1fe3ce9..f20815db 100644 --- a/docker/web/nspanelmanager/web/api.py +++ b/docker/web/nspanelmanager/web/api.py @@ -324,13 +324,13 @@ def get_nspanel_config(request): nspanel.id, "button2_mqtt_payload", "" ) - if nspanel.button1_detached_mode_light: - base["button1_detached_light"] = nspanel.button1_detached_mode_light.id + if nspanel.button1_detached_mode_entity: + base["button1_detached_light"] = nspanel.button1_detached_mode_entity.id else: - base["button1_detached_mode_light"] = -1 + base["button1_detached_mode_entity"] = -1 - if nspanel.button2_detached_mode_light: - base["button2_detached_light"] = nspanel.button2_detached_mode_light.id + if nspanel.button2_detached_mode_entity: + base["button2_detached_light"] = nspanel.button2_detached_mode_entity.id else: base["button2_detached_light"] = -1 base["rooms"] = [] diff --git a/docker/web/nspanelmanager/web/components/nspanel_status_firmware_version/nspanel_status_firmware_version.py b/docker/web/nspanelmanager/web/components/nspanel_status_firmware_version/nspanel_status_firmware_version.py new file mode 100644 index 00000000..8f69cd45 --- /dev/null +++ b/docker/web/nspanelmanager/web/components/nspanel_status_firmware_version/nspanel_status_firmware_version.py @@ -0,0 +1,34 @@ +from django_components import component +from django.template.context import Context + +from web.models import NSPanel + +@component.register("nspanel_status_firmware_version") +class NSPanelStatusFirmwareVersion(component.Component): + template_view = None + + def get_context_data(self, id): + nspanel = NSPanel.objects.get(id=id) + return { + "nspanel": nspanel, + } + + def get_template_name(self, context: Context): + if self.template_view: + url_name = self.template_view + else: + url_name = context.request.resolver_match.url_name + if url_name == "htmx_partial_index_nspanels_section" or url_name == "index": + return "nspanel_status_firmware_version/nspanel_status_firmware_version_index.html" + elif url_name == "edit_nspanel": + return "nspanel_status_firmware_version/nspanel_status_firmware_version_edit_nspanel.html" + + def get(self, request, view, nspanel_id): + self.template_view = view + args = { + "id": nspanel_id, + } + return self.render_to_response(kwargs=args) + + class Media: + css = "css/main.css" diff --git a/docker/web/nspanelmanager/web/components/nspanel_status_firmware_version/nspanel_status_firmware_version_edit_nspanel.html b/docker/web/nspanelmanager/web/components/nspanel_status_firmware_version/nspanel_status_firmware_version_edit_nspanel.html new file mode 100644 index 00000000..88111b8c --- /dev/null +++ b/docker/web/nspanelmanager/web/components/nspanel_status_firmware_version/nspanel_status_firmware_version_edit_nspanel.html @@ -0,0 +1,54 @@ + + + diff --git a/docker/web/nspanelmanager/web/components/nspanel_status_firmware_version/nspanel_status_firmware_version_index.html b/docker/web/nspanelmanager/web/components/nspanel_status_firmware_version/nspanel_status_firmware_version_index.html new file mode 100644 index 00000000..a1bc0de0 --- /dev/null +++ b/docker/web/nspanelmanager/web/components/nspanel_status_firmware_version/nspanel_status_firmware_version_index.html @@ -0,0 +1,49 @@ + + + diff --git a/docker/web/nspanelmanager/web/migrations/0068_nspanel_button1_fallback_mode_and_more.py b/docker/web/nspanelmanager/web/migrations/0068_nspanel_button1_fallback_mode_and_more.py new file mode 100644 index 00000000..8c0da706 --- /dev/null +++ b/docker/web/nspanelmanager/web/migrations/0068_nspanel_button1_fallback_mode_and_more.py @@ -0,0 +1,33 @@ +# Generated by Django 5.1.1 on 2026-01-28 14:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('web', '0067_nspanel_button1_long_detached_mode_entity_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='nspanel', + name='button1_fallback_mode', + field=models.IntegerField(default=0, null=True), + ), + migrations.AddField( + model_name='nspanel', + name='button1_long_fallback_mode', + field=models.IntegerField(default=0, null=True), + ), + migrations.AddField( + model_name='nspanel', + name='button2_fallback_mode', + field=models.IntegerField(default=0, null=True), + ), + migrations.AddField( + model_name='nspanel', + name='button2_long_fallback_mode', + field=models.IntegerField(default=0, null=True), + ), + ] diff --git a/docker/web/nspanelmanager/web/models.py b/docker/web/nspanelmanager/web/models.py index 5fc5565a..5e2e5f8e 100755 --- a/docker/web/nspanelmanager/web/models.py +++ b/docker/web/nspanelmanager/web/models.py @@ -54,13 +54,25 @@ class NSPanel(models.Model): version = models.CharField(max_length=15, default="") room = models.ForeignKey(Room, on_delete=models.CASCADE) button1_mode = models.IntegerField(default=0) + button1_fallback_mode = models.IntegerField(default=0) button1_detached_mode_entity = models.ForeignKey( "Entity", on_delete=models.SET_NULL, blank=True, null=True, related_name="+" ) button2_mode = models.IntegerField(default=0) + button2_fallback_mode = models.IntegerField(default=0) button2_detached_mode_entity = models.ForeignKey( "Entity", on_delete=models.SET_NULL, blank=True, null=True, related_name="+" ) + button1_long_mode = models.IntegerField(default=0) + button1_long_fallback_mode = models.IntegerField(default=0) + button1_long_detached_mode_entity = models.ForeignKey( + "Entity", on_delete=models.SET_NULL, blank=True, null=True, related_name="+" + ) + button2_long_mode = models.IntegerField(default=0) + button2_long_fallback_mode = models.IntegerField(default=0) + button2_long_detached_mode_entity = models.ForeignKey( + "Entity", on_delete=models.SET_NULL, blank=True, null=True, related_name="+" + ) md5_firmware = models.CharField(max_length=64, default="") md5_data_file = models.CharField(max_length=64, default="") md5_tft_file = models.CharField(max_length=64, default="") diff --git a/docker/web/nspanelmanager/web/protobuf/protobuf_mqttmanager_pb2.py b/docker/web/nspanelmanager/web/protobuf/protobuf_mqttmanager_pb2.py index 37f79301..15d1392e 100644 --- a/docker/web/nspanelmanager/web/protobuf/protobuf_mqttmanager_pb2.py +++ b/docker/web/nspanelmanager/web/protobuf/protobuf_mqttmanager_pb2.py @@ -25,7 +25,7 @@ import web.protobuf.protobuf_formats_pb2 as protobuf__formats__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1aprotobuf_mqttmanager.proto\x1a\x16protobuf_formats.proto\"\xa6\x0e\n\x0fNSPanelSettings\x12\x0f\n\x02id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x13\n\x0bmac_address\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x0c\n\x04home\x18\x04 \x01(\x05\x12\x39\n\x0c\x64\x65\x66\x61ult_page\x18\x05 \x01(\x0e\x32#.NSPanelSettings.NSPanelDefaultPage\x12 \n\x18raise_to_100_light_level\x18\x06 \x01(\x05\x12\x1c\n\x14min_button_push_time\x18\n \x01(\x05\x12\x1e\n\x16\x62utton_long_press_time\x18\x0b \x01(\x05\x12!\n\x19special_mode_trigger_time\x18\x0c \x01(\x05\x12!\n\x19special_mode_release_time\x18\r \x01(\x05\x12\x18\n\x10screen_dim_level\x18\x0f \x01(\x05\x12\x1d\n\x15screensaver_dim_level\x18\x10 \x01(\x05\x12&\n\x1escreensaver_activation_timeout\x18\x11 \x01(\x05\x12\x41\n\x10screensaver_mode\x18\x12 \x01(\x0e\x32\'.NSPanelSettings.NSPanelScreensaverMode\x12\"\n\x0c\x63lock_format\x18\x13 \x01(\x0e\x32\x0c.time_format\x12-\n\x10temperature_unit\x18\x14 \x01(\x0e\x32\x13.temperature_format\x12\x13\n\x0bis_us_panel\x18\x15 \x01(\x08\x12\x1c\n\x14lock_to_default_room\x18\x16 \x01(\x08\x12\x16\n\x0ereverse_relays\x18\x17 \x01(\x08\x12\x1b\n\x13relay1_default_mode\x18\x18 \x01(\x08\x12\x1b\n\x13relay2_default_mode\x18\x19 \x01(\x08\x12\x1f\n\x17temperature_calibration\x18\x1a \x01(\x05\x12\x38\n\x0c\x62utton1_mode\x18\x1b \x01(\x0e\x32\".NSPanelSettings.NSPanelButtonMode\x12\x38\n\x0c\x62utton2_mode\x18\x1c \x01(\x0e\x32\".NSPanelSettings.NSPanelButtonMode\x12\x1f\n\x12\x62utton1_mqtt_topic\x18\x1d \x01(\tH\x01\x88\x01\x01\x12\x1f\n\x12\x62utton2_mqtt_topic\x18\x1e \x01(\tH\x02\x88\x01\x01\x12!\n\x14\x62utton1_mqtt_payload\x18\x1f \x01(\tH\x03\x88\x01\x01\x12!\n\x14\x62utton2_mqtt_payload\x18 \x01(\tH\x04\x88\x01\x01\x12&\n\x19\x62utton1_detached_light_id\x18! \x01(\x05H\x05\x88\x01\x01\x12&\n\x19\x62utton2_detached_light_id\x18\" \x01(\x05H\x06\x88\x01\x01\x12\x0e\n\x06\x64\x65nied\x18- \x01(\x08\x12\x10\n\x08\x61\x63\x63\x65pted\x18. \x01(\x08\x12\r\n\x05rooms\x18/ \x03(\x05\x12\x0e\n\x06scenes\x18\x30 \x03(\x05\x12\x12\n\nip_address\x18\x31 \x01(\t\x12@\n\x14relay1_register_type\x18\x32 \x01(\x0e\x32\".NSPanelSettings.RelayRegisterType\x12@\n\x14relay2_register_type\x18\x33 \x01(\x0e\x32\".NSPanelSettings.RelayRegisterType\x12\x14\n\x0c\x64\x65\x66\x61ult_room\x18\x34 \x01(\x05\"C\n\x12NSPanelDefaultPage\x12\r\n\tMAIN_PAGE\x10\x00\x12\x0f\n\x0bSCENES_PAGE\x10\x01\x12\r\n\tROOM_PAGE\x10\x02\"\xa8\x01\n\x16NSPanelScreensaverMode\x12\x1b\n\x17WEATHER_WITH_BACKGROUND\x10\x00\x12\x1e\n\x1aWEATHER_WITHOUT_BACKGROUND\x10\x01\x12\x1c\n\x18\x44\x41TETIME_WITH_BACKGROUND\x10\x03\x12\x1f\n\x1b\x44\x41TETIME_WITHOUT_BACKGROUND\x10\x04\x12\x12\n\x0eNO_SCREENSAVER\x10\x05\"Y\n\x11NSPanelButtonMode\x12\x0f\n\x0b\x44IRECT_MODE\x10\x00\x12\x11\n\rDETACHED_MODE\x10\x01\x12\x0f\n\x0b\x43USTOM_MQTT\x10\x02\x12\x0f\n\x0b\x46OLLOW_MODE\x10\x03\"*\n\x11RelayRegisterType\x12\n\n\x06SWITCH\x10\x00\x12\t\n\x05LIGHT\x10\x01\x42\x05\n\x03_idB\x15\n\x13_button1_mqtt_topicB\x15\n\x13_button2_mqtt_topicB\x17\n\x15_button1_mqtt_payloadB\x17\n\x15_button2_mqtt_payloadB\x1c\n\x1a_button1_detached_light_idB\x1c\n\x1a_button2_detached_light_id\">\n\x18MultipleNSPanelsSettings\x12\"\n\x08nspanels\x18\x01 \x03(\x0b\x32\x10.NSPanelSettingsb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1aprotobuf_mqttmanager.proto\x1a\x16protobuf_formats.proto\"\xc7\x15\n\x0fNSPanelSettings\x12\x0f\n\x02id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x13\n\x0bmac_address\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x0c\n\x04home\x18\x04 \x01(\x05\x12\x39\n\x0c\x64\x65\x66\x61ult_page\x18\x05 \x01(\x0e\x32#.NSPanelSettings.NSPanelDefaultPage\x12 \n\x18raise_to_100_light_level\x18\x06 \x01(\x05\x12\x1c\n\x14min_button_push_time\x18\n \x01(\x05\x12\x1e\n\x16\x62utton_long_press_time\x18\x0b \x01(\x05\x12!\n\x19special_mode_trigger_time\x18\x0c \x01(\x05\x12!\n\x19special_mode_release_time\x18\r \x01(\x05\x12\x18\n\x10screen_dim_level\x18\x0f \x01(\x05\x12\x1d\n\x15screensaver_dim_level\x18\x10 \x01(\x05\x12&\n\x1escreensaver_activation_timeout\x18\x11 \x01(\x05\x12\x41\n\x10screensaver_mode\x18\x12 \x01(\x0e\x32\'.NSPanelSettings.NSPanelScreensaverMode\x12\"\n\x0c\x63lock_format\x18\x13 \x01(\x0e\x32\x0c.time_format\x12-\n\x10temperature_unit\x18\x14 \x01(\x0e\x32\x13.temperature_format\x12\x13\n\x0bis_us_panel\x18\x15 \x01(\x08\x12\x1c\n\x14lock_to_default_room\x18\x16 \x01(\x08\x12\x16\n\x0ereverse_relays\x18\x17 \x01(\x08\x12\x1b\n\x13relay1_default_mode\x18\x18 \x01(\x08\x12\x1b\n\x13relay2_default_mode\x18\x19 \x01(\x08\x12\x1f\n\x17temperature_calibration\x18\x1a \x01(\x05\x12\x38\n\x0c\x62utton1_mode\x18\x1e \x01(\x0e\x32\".NSPanelSettings.NSPanelButtonMode\x12\x44\n\x10\x62utton1_fallback\x18\x1f \x01(\x0e\x32*.NSPanelSettings.NSPanelButtonFallbackMode\x12\x38\n\x0c\x62utton2_mode\x18 \x01(\x0e\x32\".NSPanelSettings.NSPanelButtonMode\x12\x44\n\x10\x62utton2_fallback\x18! \x01(\x0e\x32*.NSPanelSettings.NSPanelButtonFallbackMode\x12=\n\x11\x62utton1_long_mode\x18\" \x01(\x0e\x32\".NSPanelSettings.NSPanelButtonMode\x12I\n\x15\x62utton1_long_fallback\x18# \x01(\x0e\x32*.NSPanelSettings.NSPanelButtonFallbackMode\x12=\n\x11\x62utton2_long_mode\x18$ \x01(\x0e\x32\".NSPanelSettings.NSPanelButtonMode\x12I\n\x15\x62utton2_long_fallback\x18% \x01(\x0e\x32*.NSPanelSettings.NSPanelButtonFallbackMode\x12\x1f\n\x12\x62utton1_mqtt_topic\x18& \x01(\tH\x01\x88\x01\x01\x12\x1f\n\x12\x62utton2_mqtt_topic\x18\' \x01(\tH\x02\x88\x01\x01\x12!\n\x14\x62utton1_mqtt_payload\x18( \x01(\tH\x03\x88\x01\x01\x12!\n\x14\x62utton2_mqtt_payload\x18) \x01(\tH\x04\x88\x01\x01\x12&\n\x19\x62utton1_detached_light_id\x18* \x01(\x05H\x05\x88\x01\x01\x12&\n\x19\x62utton2_detached_light_id\x18+ \x01(\x05H\x06\x88\x01\x01\x12$\n\x17\x62utton1_long_mqtt_topic\x18, \x01(\tH\x07\x88\x01\x01\x12$\n\x17\x62utton2_long_mqtt_topic\x18- \x01(\tH\x08\x88\x01\x01\x12&\n\x19\x62utton1_long_mqtt_payload\x18. \x01(\tH\t\x88\x01\x01\x12&\n\x19\x62utton2_long_mqtt_payload\x18/ \x01(\tH\n\x88\x01\x01\x12+\n\x1e\x62utton1_long_detached_light_id\x18\x30 \x01(\x05H\x0b\x88\x01\x01\x12+\n\x1e\x62utton2_long_detached_light_id\x18\x31 \x01(\x05H\x0c\x88\x01\x01\x12\x0e\n\x06\x64\x65nied\x18\x32 \x01(\x08\x12\x10\n\x08\x61\x63\x63\x65pted\x18\x33 \x01(\x08\x12\r\n\x05rooms\x18\x34 \x03(\x05\x12\x0e\n\x06scenes\x18\x35 \x03(\x05\x12\x12\n\nip_address\x18\x36 \x01(\t\x12@\n\x14relay1_register_type\x18\x37 \x01(\x0e\x32\".NSPanelSettings.RelayRegisterType\x12@\n\x14relay2_register_type\x18\x38 \x01(\x0e\x32\".NSPanelSettings.RelayRegisterType\x12\x14\n\x0c\x64\x65\x66\x61ult_room\x18\x39 \x01(\x05\"C\n\x12NSPanelDefaultPage\x12\r\n\tMAIN_PAGE\x10\x00\x12\x0f\n\x0bSCENES_PAGE\x10\x01\x12\r\n\tROOM_PAGE\x10\x02\"\xa8\x01\n\x16NSPanelScreensaverMode\x12\x1b\n\x17WEATHER_WITH_BACKGROUND\x10\x00\x12\x1e\n\x1aWEATHER_WITHOUT_BACKGROUND\x10\x01\x12\x1c\n\x18\x44\x41TETIME_WITH_BACKGROUND\x10\x03\x12\x1f\n\x1b\x44\x41TETIME_WITHOUT_BACKGROUND\x10\x04\x12\x12\n\x0eNO_SCREENSAVER\x10\x05\"Y\n\x11NSPanelButtonMode\x12\x0f\n\x0b\x44IRECT_MODE\x10\x00\x12\x11\n\rDETACHED_MODE\x10\x01\x12\x0f\n\x0b\x43USTOM_MQTT\x10\x02\x12\x0f\n\x0b\x46OLLOW_MODE\x10\x03\"O\n\x19NSPanelButtonFallbackMode\x12\x0c\n\x08\x44ISABLED\x10\x00\x12\x11\n\rTOGGLE_RELAY1\x10\x01\x12\x11\n\rTOGLLE_RELAY2\x10\x02\"*\n\x11RelayRegisterType\x12\n\n\x06SWITCH\x10\x00\x12\t\n\x05LIGHT\x10\x01\x42\x05\n\x03_idB\x15\n\x13_button1_mqtt_topicB\x15\n\x13_button2_mqtt_topicB\x17\n\x15_button1_mqtt_payloadB\x17\n\x15_button2_mqtt_payloadB\x1c\n\x1a_button1_detached_light_idB\x1c\n\x1a_button2_detached_light_idB\x1a\n\x18_button1_long_mqtt_topicB\x1a\n\x18_button2_long_mqtt_topicB\x1c\n\x1a_button1_long_mqtt_payloadB\x1c\n\x1a_button2_long_mqtt_payloadB!\n\x1f_button1_long_detached_light_idB!\n\x1f_button2_long_detached_light_id\">\n\x18MultipleNSPanelsSettings\x12\"\n\x08nspanels\x18\x01 \x03(\x0b\x32\x10.NSPanelSettingsb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -33,15 +33,17 @@ if not _descriptor._USE_C_DESCRIPTORS: DESCRIPTOR._loaded_options = None _globals['_NSPANELSETTINGS']._serialized_start=55 - _globals['_NSPANELSETTINGS']._serialized_end=1885 - _globals['_NSPANELSETTINGS_NSPANELDEFAULTPAGE']._serialized_start=1349 - _globals['_NSPANELSETTINGS_NSPANELDEFAULTPAGE']._serialized_end=1416 - _globals['_NSPANELSETTINGS_NSPANELSCREENSAVERMODE']._serialized_start=1419 - _globals['_NSPANELSETTINGS_NSPANELSCREENSAVERMODE']._serialized_end=1587 - _globals['_NSPANELSETTINGS_NSPANELBUTTONMODE']._serialized_start=1589 - _globals['_NSPANELSETTINGS_NSPANELBUTTONMODE']._serialized_end=1678 - _globals['_NSPANELSETTINGS_RELAYREGISTERTYPE']._serialized_start=1680 - _globals['_NSPANELSETTINGS_RELAYREGISTERTYPE']._serialized_end=1722 - _globals['_MULTIPLENSPANELSSETTINGS']._serialized_start=1887 - _globals['_MULTIPLENSPANELSSETTINGS']._serialized_end=1949 + _globals['_NSPANELSETTINGS']._serialized_end=2814 + _globals['_NSPANELSETTINGS_NSPANELDEFAULTPAGE']._serialized_start=2011 + _globals['_NSPANELSETTINGS_NSPANELDEFAULTPAGE']._serialized_end=2078 + _globals['_NSPANELSETTINGS_NSPANELSCREENSAVERMODE']._serialized_start=2081 + _globals['_NSPANELSETTINGS_NSPANELSCREENSAVERMODE']._serialized_end=2249 + _globals['_NSPANELSETTINGS_NSPANELBUTTONMODE']._serialized_start=2251 + _globals['_NSPANELSETTINGS_NSPANELBUTTONMODE']._serialized_end=2340 + _globals['_NSPANELSETTINGS_NSPANELBUTTONFALLBACKMODE']._serialized_start=2342 + _globals['_NSPANELSETTINGS_NSPANELBUTTONFALLBACKMODE']._serialized_end=2421 + _globals['_NSPANELSETTINGS_RELAYREGISTERTYPE']._serialized_start=2423 + _globals['_NSPANELSETTINGS_RELAYREGISTERTYPE']._serialized_end=2465 + _globals['_MULTIPLENSPANELSSETTINGS']._serialized_start=2816 + _globals['_MULTIPLENSPANELSSETTINGS']._serialized_end=2878 # @@protoc_insertion_point(module_scope) diff --git a/docker/web/nspanelmanager/web/rest.py b/docker/web/nspanelmanager/web/rest.py index 76e5d6f7..97f2bf5b 100644 --- a/docker/web/nspanelmanager/web/rest.py +++ b/docker/web/nspanelmanager/web/rest.py @@ -187,8 +187,8 @@ def nspanels_get(request): "button2_mqtt_topic": get_nspanel_setting_with_default(nspanel.id, "button2_mqtt_topic", ""), "button1_mqtt_payload": get_nspanel_setting_with_default(nspanel.id, "button1_mqtt_payload", ""), "button2_mqtt_payload": get_nspanel_setting_with_default(nspanel.id, "button2_mqtt_payload", ""), - "button1_detached_light": nspanel.button1_detached_mode_light.id if nspanel.button1_detached_mode_light else -1, - "button2_detached_light": nspanel.button2_detached_mode_light.id if nspanel.button2_detached_mode_light else -1, + "button1_detached_light": nspanel.button1_detached_mode_entity.id if nspanel.button1_detached_mode_entity else -1, + "button2_detached_light": nspanel.button2_detached_mode_entity.id if nspanel.button2_detached_mode_entity else -1, "denied": nspanel.denied, "accepted": nspanel.accepted, "rooms": [room.id for room in Room.objects.all().order_by('displayOrder')], diff --git a/docker/web/nspanelmanager/web/static/edit_nspanel.js b/docker/web/nspanelmanager/web/static/edit_nspanel.js index e75e41c8..776ba3d1 100644 --- a/docker/web/nspanelmanager/web/static/edit_nspanel.js +++ b/docker/web/nspanelmanager/web/static/edit_nspanel.js @@ -39,138 +39,87 @@ function push_log_message_to_view(data) { $("#log_body").prepend(add_html); } -function update_shown_elements() { - $("#button1_detached_mode_controls").addClass("hidden"); - $("#button2_detached_mode_controls").addClass("hidden"); - $("#button1_detached_mode_light").addClass("hidden"); - $("#button2_detached_mode_light").addClass("hidden"); - $("#button1_mqtt_mode_controls").addClass("hidden"); - $("#button2_mqtt_mode_controls").addClass("hidden"); - $("#button1_thermostat_mode_controls").addClass("hidden"); - $("#button2_thermostat_mode_controls").addClass("hidden"); - $("#button1_detached_mode_light").prop("required", false); - $("#button2_detached_mode_light").prop("required", false); - $("#button1_relay_lower_temperature").prop("required", false); - $("#button1_relay_upper_temperature").prop("required", false); - $("#button2_relay_lower_temperature").prop("required", false); - $("#button2_relay_upper_temperature").prop("required", false); - - if ($("#button1_mode").val() == 0) { +function update_shown_elements(button) { + $(`#${button}_detached_mode_controls`).addClass("hidden"); + $(`#${button}_detached_mode_entity`).addClass("hidden"); + $(`#${button}_mqtt_mode_controls`).addClass("hidden"); + $(`#${button}_thermostat_mode_controls`).addClass("hidden"); + $(`#${button}_detached_mode_entity`).prop("required", false); + $(`#${button}_relay_lower_temperature`).prop("required", false); + $(`#${button}_relay_upper_temperature`).prop("required", false); + + if ($(`#${button}_mode`).val() == 0) { // Direct mode - } else if ($("#button1_mode").val() == 1) { + } else if ($(`#${button}_mode`).val() == 1) { // Detached mode - $("#button1_detached_mode_controls").removeClass("hidden"); - $("#button1_detached_mode_light").prop("required", true); - $("#button1_detached_mode_light").removeClass("hidden"); - } else if ($("#button1_mode").val() == 2) { + $(`#${button}_detached_mode_controls`).removeClass("hidden"); + $(`#${button}_detached_mode_entity`).prop("required", true); + $(`#${button}_detached_mode_entity`).removeClass("hidden"); + } else if ($(`#${button}_mode`).val() == 2) { // MQTT mode - $("#button1_mqtt_mode_controls").removeClass("hidden"); - } else if ($("#button1_mode").val() == 3) { + $(`#${button}_mqtt_mode_controls`).removeClass("hidden"); + } else if ($(`#${button}_mode`).val() == 3) { // Follow mode - } else if ($("#button1_mode").val() == 4 || $("#button1_mode").val() == 5) { + } else if ($(`#${button}_mode`).val() == 4 || $(`#${button}_mode`).val() == 5) { // Thermostat mode - $("#button1_thermostat_mode_controls").removeClass("hidden"); - $("#button1_relay_lower_temperature").prop("required", true); - $("#button1_relay_upper_temperature").prop("required", true); + $(`#${button}_thermostat_mode_controls`).removeClass("hidden"); + $(`#${button}_relay_lower_temperature`).prop("required", true); + $(`#${button}_relay_upper_temperature`).prop("required", true); } - if ($("#button2_mode").val() == 0) { - // Direct mode - } else if ($("#button2_mode").val() == 1) { - // Detached mode - $("#button2_detached_mode_controls").removeClass("hidden"); - $("#button2_detached_mode_light").prop("required", true); - $("#button2_detached_mode_light").removeClass("hidden"); - } else if ($("#button2_mode").val() == 2) { - // MQTT mode - $("#button2_mqtt_mode_controls").removeClass("hidden"); - } else if ($("#button2_mode").val() == 3) { - // Follow mode - } else if ($("#button2_mode").val() == 4 || $("#button2_mode").val() == 5) { - // Thermostat mode - $("#button2_thermostat_mode_controls").removeClass("hidden"); - $("#button2_relay_lower_temperature").prop("required", true); - $("#button2_relay_upper_temperature").prop("required", true); + // show/hide fallback mode + if ($(`#${button}_mode`).val() == 0) { + // Direct mode does not have fallback mode + $(`#${button}_fallback_mode_controls`).addClass("hidden"); + } else { + $(`#${button}_fallback_mode_controls`).removeClass("hidden"); } // Update shown lights depending on selected room - var button1_selected_room_id = $("#button1_detached_mode_room").val(); + var selected_room_id = $(`#${button}_detached_mode_room`).val(); $( - ".button1_detached_mode_light_option[data-room-id='" + - button1_selected_room_id + - "']", + `.${button}_detached_mode_entity_option[data-room-id='` + + selected_room_id + + "']", ).show(); $( - ".button1_detached_mode_light_option[data-room-id!='" + - button1_selected_room_id + - "']", + `.${button}_detached_mode_entity_option[data-room-id!='` + + selected_room_id + + "']", ).hide(); - // Check if selected button1_detached_mode_light option is visible, if not, select the first of the options. + // Check if selected button1_detached_mode_entity option is visible, if not, select the first of the options. if ( $( - ".button1_detached_mode_light_option[data-room-id='" + - button1_selected_room_id + - "']:selected", + `.${button}_detached_mode_entity_option[data-room-id='` + + selected_room_id + + "']:selected", ).length == 0 ) { - var button1_detached_light_first_value = $( - ".button1_detached_mode_light_option[data-room-id='" + - button1_selected_room_id + - "']:first", + var detached_light_first_value = $( + `.${button}_detached_mode_entity_option[data-room-id='` + + selected_room_id + + "']:first", ).val(); - if (button1_detached_light_first_value) { + if (detached_light_first_value) { console.log( - "Selected option for button1 detached light is no longer accessible in selected room, will select '", - button1_detached_light_first_value, + `Selected option for ${button} detached light is no longer accessible in selected room, will select '`, + detached_light_first_value, "' instead.", ); - $("#button1_detached_mode_light") - .val(button1_detached_light_first_value) + $(`#${button}_detached_mode_entity`) + .val(detached_light_first_value) .change(); } else { - $("#button1_detached_mode_light").val("").change(); + $(`#${button}_detached_mode_entity`).val("").change(); } } - var button2_selected_room_id = $("#button2_detached_mode_room").val(); - $( - ".button2_detached_mode_light_option[data-room-id='" + - button2_selected_room_id + - "']", - ).show(); - $( - ".button2_detached_mode_light_option[data-room-id!='" + - button2_selected_room_id + - "']", - ).hide(); - // Check if selected button2_detached_mode_light option is visible, if not, select the first of the options. - if ( - $( - ".button2_detached_mode_light_option[data-room-id='" + - button2_selected_room_id + - "']:selected", - ).length == 0 - ) { - var button2_detached_light_first_value = $( - ".button2_detached_mode_light_option[data-room-id='" + - button2_selected_room_id + - "']:first", - ).val(); - if (button2_detached_light_first_value) { - console.log( - "Selected option for button2 detached light is no longer accessible in selected room, will select '", - button2_detached_light_first_value, - "' instead.", - ); - $("#button2_detached_mode_light") - .val(button2_detached_light_first_value) - .change(); - } else { - $("#button2_detached_mode_light").val("").change(); - } - } + +} + +function update_screeensave_mode() { // Update if screensaver outside temperature setting is available or not. var screensaver_mode = $("#screensaver_mode").val(); @@ -226,13 +175,13 @@ $(document).ready(() => { } }); }); - update_shown_elements(); - $("#button1_mode").change(update_shown_elements); - $("#button2_mode").change(update_shown_elements); - $("#screensaver_mode").change(update_shown_elements); - $("#button1_detached_mode_room").change(update_shown_elements); - $("#button2_detached_mode_room").change(update_shown_elements); + for (let button of ["button1", "button2", "button1_long", "button2_long"]) { + update_shown_elements(button); + $(`#${button}_mode`).change(() => update_shown_elements(button)); + $(`#${button}_detached_mode_room`).change(() => update_shown_elements(button)); + } + $("#screensaver_mode").change(update_screeensave_mode); $("#panel_type").on("change", update_nspanel_example_view); update_nspanel_example_view(); // Update once manually depending on selected choice. diff --git a/docker/web/nspanelmanager/web/templates/edit_nspanel.html b/docker/web/nspanelmanager/web/templates/edit_nspanel.html index 262448a0..3306c75c 100644 --- a/docker/web/nspanelmanager/web/templates/edit_nspanel.html +++ b/docker/web/nspanelmanager/web/templates/edit_nspanel.html @@ -340,287 +340,14 @@

MAC: {{ panel_info.data.ma
- -
- -
- - - - -
- - - - - - - - - - - -
- - -
- -
- - - - -
- - - - - - - - - - - -
+ {% include "partial/edit_nspanel_buttons.html" with button="button1" button_name="Left button" %} + {% include "partial/edit_nspanel_buttons.html" with button="button2" button_name="Right button" %}
+
+ {% include "partial/edit_nspanel_buttons.html" with button="button1_long" button_name="Left button long press" %} + {% include "partial/edit_nspanel_buttons.html" with button="button2_long" button_name="Right button long press" %} +
@@ -901,6 +628,9 @@

Screensaver outside temperature

{% component "nspanel_status_ram_usage" id=panel_info.data.id %}{% endcomponent %}
+
+ {% component "nspanel_status_firmware_version" id=panel_info.data.id %}{% endcomponent %} +
{% component "nspanel_status_temperature" id=panel_info.data.id %}{% endcomponent %}
diff --git a/docker/web/nspanelmanager/web/templates/partial/edit_nspanel_buttons.html b/docker/web/nspanelmanager/web/templates/partial/edit_nspanel_buttons.html new file mode 100644 index 00000000..e89dbb8b --- /dev/null +++ b/docker/web/nspanelmanager/web/templates/partial/edit_nspanel_buttons.html @@ -0,0 +1,187 @@ + +
+ +
+ + + + +
+ + + + + + + + + + + + +
diff --git a/docker/web/nspanelmanager/web/templates/partial/nspanel_index_view_htmx.html b/docker/web/nspanelmanager/web/templates/partial/nspanel_index_view_htmx.html index bdafc8b5..1beee583 100644 --- a/docker/web/nspanelmanager/web/templates/partial/nspanel_index_view_htmx.html +++ b/docker/web/nspanelmanager/web/templates/partial/nspanel_index_view_htmx.html @@ -71,6 +71,12 @@ {% component "nspanel_status_ram_usage" id=nspanel.data.id %}{% endcomponent %}
+
+ +
+ {% component "nspanel_status_firmware_version" id=nspanel.data.id %}{% endcomponent %} +
+