From 97391368e16c9602d93733ca6bd015e8a075df9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Labb=C3=A9?= Date: Tue, 21 May 2024 11:46:22 +0200 Subject: [PATCH] GH-46: Generated files for Humidity Control Cluster Forwarded: https://github.com/SiliconLabs/UnifySDK/pull/46 Bug-SiliconLabs: UIC-3042 Bug-Github: https://github.com/SiliconLabs/UnifySDK/pull/46 --- .../cluster-types/cluster-type-attributes.ts | 2 +- .../cluster-type-attributes.ts.rej | 12 + .../include/dotdot_attribute_id_definitions.h | 20 + .../dotdot_cluster_command_id_definitions.h | 4 + .../include/dotdot_cluster_id_definitions.h | 4 + .../zap-generated/include/zap-types.h | 40 + .../readme_ucl_mqtt_reference.md | 1335 ++++++++++ .../src/dotdot_attribute_id_definitions.c | 171 ++ .../src/dotdot_cluster_id_definitions.c | 5 + .../zap-generated/include/dotdot_mqtt.h | 847 +++++++ .../include/dotdot_mqtt_attributes.h | 256 ++ .../include/dotdot_mqtt_generated_commands.h | 64 + .../include/dotdot_mqtt_group_commands.h | 49 + .../include/dotdot_mqtt_helpers.h | 28 + .../include/dotdot_mqtt_helpers.hpp | 68 + .../include/dotdot_mqtt_send_commands.h | 78 + ...dotdot_mqtt_supported_generated_commands.h | 30 + .../zap-generated/src/dotdot_mqtt.cpp | 2211 +++++++++++++++++ .../zap-generated/src/dotdot_mqtt.hpp | 86 + .../src/dotdot_mqtt_attributes.cpp | 1682 +++++++++++++ .../src/dotdot_mqtt_command_helpers.cpp | 175 ++ .../src/dotdot_mqtt_command_helpers.hpp | 74 + .../src/dotdot_mqtt_generated_commands.cpp | 126 + .../src/dotdot_mqtt_group_commands.cpp | 311 +++ .../zap-generated/src/dotdot_mqtt_helpers.cpp | 434 ++++ .../src/dotdot_mqtt_send_commands.cpp | 148 ++ ...tdot_mqtt_supported_generated_commands.cpp | 49 + .../test/dotdot_mqtt_test.include | 41 + .../include/dotdot_attributes.uam | 21 + .../include/dotdot_attributes_camel_case.uam | 21 + .../unify_dotdot_attribute_store_helpers.h | 2042 +++++++++++++++ .../unify_dotdot_defined_attribute_types.h | 20 + ...ot_attribute_store_attribute_publisher.cpp | 877 +++++++ ..._force_read_attributes_command_callbacks.c | 122 + .../unify_dotdot_attribute_store_helpers.cpp | 2188 ++++++++++++++++ ...fy_dotdot_attribute_store_registration.cpp | 456 ++++ ...store_write_attributes_command_callbacks.c | 37 + .../test/unify_dotdot_attribute_store_test.c | 137 + .../test/unify_dotdot_attribute_store_test.h | 10 + 39 files changed, 14280 insertions(+), 1 deletion(-) create mode 100644 applications/dev_ui/dev_gui/zap-generated/src/cluster-types/cluster-type-attributes.ts.rej diff --git a/applications/dev_ui/dev_gui/zap-generated/src/cluster-types/cluster-type-attributes.ts b/applications/dev_ui/dev_gui/zap-generated/src/cluster-types/cluster-type-attributes.ts index 15eb5413c..339469d26 100644 --- a/applications/dev_ui/dev_gui/zap-generated/src/cluster-types/cluster-type-attributes.ts +++ b/applications/dev_ui/dev_gui/zap-generated/src/cluster-types/cluster-type-attributes.ts @@ -15863,5 +15863,5 @@ export let ClusterTypeAttrs: any = { commands: [ ] } - } + }, } diff --git a/applications/dev_ui/dev_gui/zap-generated/src/cluster-types/cluster-type-attributes.ts.rej b/applications/dev_ui/dev_gui/zap-generated/src/cluster-types/cluster-type-attributes.ts.rej new file mode 100644 index 000000000..a1c746e1e --- /dev/null +++ b/applications/dev_ui/dev_gui/zap-generated/src/cluster-types/cluster-type-attributes.ts.rej @@ -0,0 +1,12 @@ +diff a/applications/dev_ui/dev_gui/zap-generated/src/cluster-types/cluster-type-attributes.ts b/applications/dev_ui/dev_gui/zap-generated/src/cluster-types/cluster-type-attributes.ts (rejected hunks) +@@ -1,8 +1,8 @@ + //This file is generated automatically. Don't try to change something here. + //To add support for new clusters, modify addon-helper.js + //To change the stucture of the ClusterTypeAttrs, modify cluster-type-attributes.zapt +- +- ++ ++ + //generate ClusterTypes + export let ClusterTypeAttrs: any = { + Basic: { diff --git a/components/uic_dotdot/zap-generated/include/dotdot_attribute_id_definitions.h b/components/uic_dotdot/zap-generated/include/dotdot_attribute_id_definitions.h index 70c0a280c..fc488c7fa 100644 --- a/components/uic_dotdot/zap-generated/include/dotdot_attribute_id_definitions.h +++ b/components/uic_dotdot/zap-generated/include/dotdot_attribute_id_definitions.h @@ -856,6 +856,26 @@ typedef enum { #define DOTDOT_PROTOCOL_CONTROLLER_NETWORK_MANAGEMENT_NETWORK_MANAGEMENT_STATE_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x1) // Definitions for cluster: Descriptor #define DOTDOT_DESCRIPTOR_DEVICE_TYPE_LIST_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x0) +// Definitions for cluster: UnifyHumidityControl +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x1) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x2) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x3) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x4) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x5) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x6) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x7) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x8) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x9) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN_ATTRIBUTE_ID ((dotdot_attribute_id_t)0xA) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX_ATTRIBUTE_ID ((dotdot_attribute_id_t)0xB) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_ATTRIBUTE_ID ((dotdot_attribute_id_t)0xC) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE_ATTRIBUTE_ID ((dotdot_attribute_id_t)0xD) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION_ATTRIBUTE_ID ((dotdot_attribute_id_t)0xE) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN_ATTRIBUTE_ID ((dotdot_attribute_id_t)0xF) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x10) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x11) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x12) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION_ATTRIBUTE_ID ((dotdot_attribute_id_t)0x13) // clang-format on diff --git a/components/uic_dotdot/zap-generated/include/dotdot_cluster_command_id_definitions.h b/components/uic_dotdot/zap-generated/include/dotdot_cluster_command_id_definitions.h index 2833fd954..cae4604f6 100644 --- a/components/uic_dotdot/zap-generated/include/dotdot_cluster_command_id_definitions.h +++ b/components/uic_dotdot/zap-generated/include/dotdot_cluster_command_id_definitions.h @@ -364,6 +364,10 @@ // Commands for cluster: Descriptor +// Commands for cluster: UnifyHumidityControl +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_MODE_SET_COMMAND_ID (0x1) +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_SETPOINT_SET_COMMAND_ID (0x1) + #ifdef __cplusplus extern "C" { #endif diff --git a/components/uic_dotdot/zap-generated/include/dotdot_cluster_id_definitions.h b/components/uic_dotdot/zap-generated/include/dotdot_cluster_id_definitions.h index 1878448a5..4884c8bac 100644 --- a/components/uic_dotdot/zap-generated/include/dotdot_cluster_id_definitions.h +++ b/components/uic_dotdot/zap-generated/include/dotdot_cluster_id_definitions.h @@ -254,6 +254,10 @@ #define DOTDOT_DESCRIPTOR_CLUSTER_ID ((dotdot_cluster_id_t)0xFD13) +// Definitions for cluster: UnifyHumidityControl +#define DOTDOT_UNIFY_HUMIDITY_CONTROL_CLUSTER_ID ((dotdot_cluster_id_t)0xFDA0) + + #ifdef __cplusplus extern "C" { #endif diff --git a/components/uic_dotdot/zap-generated/include/zap-types.h b/components/uic_dotdot/zap-generated/include/zap-types.h index fb82f117c..1c1286c4b 100644 --- a/components/uic_dotdot/zap-generated/include/zap-types.h +++ b/components/uic_dotdot/zap-generated/include/zap-types.h @@ -918,6 +918,14 @@ typedef enum { ZCL_METERING_UNITOF_MEASURE_MEGA_JOULE_MEGA_JOULE_PER_SECOND = 12, } MeteringUnitofMeasure; +// Enum for ModeType +typedef enum { + ZCL_MODE_TYPE_OFF = 0, + ZCL_MODE_TYPE_HUMIDIFY = 1, + ZCL_MODE_TYPE_DEHUMIDIFY = 2, + ZCL_MODE_TYPE_AUTO = 3, +} ModeType; + // Enum for MoveStepMode typedef enum { ZCL_MOVE_STEP_MODE_UP = 0, @@ -1092,6 +1100,12 @@ typedef enum { ZCL_SHDCFG_DIRECTION_OPENING = 1, } SHDCFGDirection; +// Enum for ScaleType +typedef enum { + ZCL_SCALE_TYPE_PERCENTAGE = 0, + ZCL_SCALE_TYPE_ABSOLUTE = 1, +} ScaleType; + // Enum for SetpointRaiseOrLowerMode typedef enum { ZCL_SETPOINT_RAISE_OR_LOWER_MODE_HEAT = 0, @@ -1099,6 +1113,13 @@ typedef enum { ZCL_SETPOINT_RAISE_OR_LOWER_MODE_BOTH = 2, } SetpointRaiseOrLowerMode; +// Enum for SetpointType +typedef enum { + ZCL_SETPOINT_TYPE_HUMIDIFIER = 1, + ZCL_SETPOINT_TYPE_DEHUMIDIFIER = 2, + ZCL_SETPOINT_TYPE_AUTO = 3, +} SetpointType; + // Enum for ShadeConfigurationMode typedef enum { ZCL_SHADE_CONFIGURATION_MODE_NORMAL = 0, @@ -1271,6 +1292,13 @@ typedef enum { ZCL_TX_REPORT_TRANSMISSION_SPEED_UNKNOWN = 255, } TxReportTransmissionSpeed; +// Enum for UnifyHumidityControlCurrentState +typedef enum { + ZCL_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE_IDLE = 0, + ZCL_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE_HUMIDIFYING = 1, + ZCL_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE_DEHUMIDIFYING = 2, +} UnifyHumidityControlCurrentState; + // Enum for WindowCoveringWindowCoveringType typedef enum { ZCL_WINDOW_COVERING_WINDOW_COVERING_TYPE_ROLLERSHADE = 0, @@ -1954,6 +1982,18 @@ typedef enum { #define TSTAT_SCHEDULE_MODE_HEAT_OFFSET (0) #define TSTAT_SCHEDULE_MODE_COOL (2) #define TSTAT_SCHEDULE_MODE_COOL_OFFSET (1) +#define UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE_HUMIDIFY (1) +#define UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE_HUMIDIFY_OFFSET (0) +#define UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE_DEHUMIDIFY (2) +#define UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE_DEHUMIDIFY_OFFSET (1) +#define UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE_AUTO (4) +#define UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE_AUTO_OFFSET (2) +#define UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS_HUMIDIFIER (1) +#define UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS_HUMIDIFIER_OFFSET (0) +#define UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS_DEHUMIDIFIER (2) +#define UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS_DEHUMIDIFIER_OFFSET (1) +#define UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS_AUTO (4) +#define UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS_AUTO_OFFSET (2) #define WINDOW_COVERING_CONFIG_OR_STATUS_OPERATIONAL (1) #define WINDOW_COVERING_CONFIG_OR_STATUS_OPERATIONAL_OFFSET (0) #define WINDOW_COVERING_CONFIG_OR_STATUS_ONLINE (2) diff --git a/components/uic_dotdot/zap-generated/readme_ucl_mqtt_reference.md b/components/uic_dotdot/zap-generated/readme_ucl_mqtt_reference.md index dbdfa36ec..951a44175 100644 --- a/components/uic_dotdot/zap-generated/readme_ucl_mqtt_reference.md +++ b/components/uic_dotdot/zap-generated/readme_ucl_mqtt_reference.md @@ -53949,6 +53949,1185 @@ mosquitto_pub -t 'ucl/by-unid///Descriptor/Commands/ForceReadAttribute +


+ + + + + + + +\page unify_humidity_control UnifyHumidityControl Cluster +The following commands and attributes are accepted as JSON payloads for the +UnifyHumidityControl cluster. + +

+ + + + +\section unify_humidity_control_attrs UnifyHumidityControl Attributes +The following attribute topics are used to retrieve the UnifyHumidityControl cluster state. + +
+ +\subsection unify_humidity_control_attr_reporting_mode UnifyHumidityControl/ReportingMode Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/ReportingMode/Reported +[PREFIX]/UnifyHumidityControl/Attributes/ReportingMode/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster ReportingMode Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "ModeType" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for ReportingMode attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/ReportingMode/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/ReportingMode/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/ReportingMode/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_supported_reporting_mode UnifyHumidityControl/SupportedReportingMode Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/SupportedReportingMode/Reported +[PREFIX]/UnifyHumidityControl/Attributes/SupportedReportingMode/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster SupportedReportingMode Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "UnifyHumidityControlSupportedReportingMode" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for SupportedReportingMode attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/SupportedReportingMode/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/SupportedReportingMode/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/SupportedReportingMode/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_current_state UnifyHumidityControl/CurrentState Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/CurrentState/Reported +[PREFIX]/UnifyHumidityControl/Attributes/CurrentState/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster CurrentState Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "UnifyHumidityControlCurrentState" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for CurrentState attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/CurrentState/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/CurrentState/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/CurrentState/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_supported_set_points UnifyHumidityControl/SupportedSetPoints Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/SupportedSetPoints/Reported +[PREFIX]/UnifyHumidityControl/Attributes/SupportedSetPoints/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster SupportedSetPoints Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "UnifyHumidityControlSupportedSetPoints" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for SupportedSetPoints attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/SupportedSetPoints/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/SupportedSetPoints/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/SupportedSetPoints/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_humidifier_setpoint_min UnifyHumidityControl/HumidifierSetpointMin Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/HumidifierSetpointMin/Reported +[PREFIX]/UnifyHumidityControl/Attributes/HumidifierSetpointMin/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster HumidifierSetpointMin Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "integer" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for HumidifierSetpointMin attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/HumidifierSetpointMin/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/HumidifierSetpointMin/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/HumidifierSetpointMin/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_humidifier_setpoint_max UnifyHumidityControl/HumidifierSetpointMax Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/HumidifierSetpointMax/Reported +[PREFIX]/UnifyHumidityControl/Attributes/HumidifierSetpointMax/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster HumidifierSetpointMax Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "integer" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for HumidifierSetpointMax attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/HumidifierSetpointMax/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/HumidifierSetpointMax/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/HumidifierSetpointMax/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_humidifier_setpoint UnifyHumidityControl/HumidifierSetpoint Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/HumidifierSetpoint/Reported +[PREFIX]/UnifyHumidityControl/Attributes/HumidifierSetpoint/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster HumidifierSetpoint Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "integer" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for HumidifierSetpoint attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/HumidifierSetpoint/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/HumidifierSetpoint/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/HumidifierSetpoint/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_humidifier_setpoint_scale UnifyHumidityControl/HumidifierSetpointScale Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/HumidifierSetpointScale/Reported +[PREFIX]/UnifyHumidityControl/Attributes/HumidifierSetpointScale/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster HumidifierSetpointScale Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "ScaleType" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for HumidifierSetpointScale attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/HumidifierSetpointScale/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/HumidifierSetpointScale/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/HumidifierSetpointScale/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_humidifier_setpoint_precision UnifyHumidityControl/HumidifierSetpointPrecision Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/HumidifierSetpointPrecision/Reported +[PREFIX]/UnifyHumidityControl/Attributes/HumidifierSetpointPrecision/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster HumidifierSetpointPrecision Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "integer" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for HumidifierSetpointPrecision attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/HumidifierSetpointPrecision/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/HumidifierSetpointPrecision/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/HumidifierSetpointPrecision/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_dehumidifier_setpoint_min UnifyHumidityControl/DehumidifierSetpointMin Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/DehumidifierSetpointMin/Reported +[PREFIX]/UnifyHumidityControl/Attributes/DehumidifierSetpointMin/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster DehumidifierSetpointMin Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "integer" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for DehumidifierSetpointMin attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/DehumidifierSetpointMin/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/DehumidifierSetpointMin/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/DehumidifierSetpointMin/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_dehumidifier_setpoint_max UnifyHumidityControl/DehumidifierSetpointMax Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/DehumidifierSetpointMax/Reported +[PREFIX]/UnifyHumidityControl/Attributes/DehumidifierSetpointMax/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster DehumidifierSetpointMax Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "integer" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for DehumidifierSetpointMax attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/DehumidifierSetpointMax/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/DehumidifierSetpointMax/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/DehumidifierSetpointMax/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_dehumidifier_setpoint UnifyHumidityControl/DehumidifierSetpoint Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/DehumidifierSetpoint/Reported +[PREFIX]/UnifyHumidityControl/Attributes/DehumidifierSetpoint/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster DehumidifierSetpoint Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "integer" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for DehumidifierSetpoint attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/DehumidifierSetpoint/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/DehumidifierSetpoint/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/DehumidifierSetpoint/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_dehumidifier_setpoint_scale UnifyHumidityControl/DehumidifierSetpointScale Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/DehumidifierSetpointScale/Reported +[PREFIX]/UnifyHumidityControl/Attributes/DehumidifierSetpointScale/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster DehumidifierSetpointScale Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "ScaleType" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for DehumidifierSetpointScale attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/DehumidifierSetpointScale/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/DehumidifierSetpointScale/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/DehumidifierSetpointScale/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_dehumidifier_setpoint_precision UnifyHumidityControl/DehumidifierSetpointPrecision Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/DehumidifierSetpointPrecision/Reported +[PREFIX]/UnifyHumidityControl/Attributes/DehumidifierSetpointPrecision/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster DehumidifierSetpointPrecision Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "integer" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for DehumidifierSetpointPrecision attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/DehumidifierSetpointPrecision/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/DehumidifierSetpointPrecision/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/DehumidifierSetpointPrecision/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_auto_setpoint_min UnifyHumidityControl/AutoSetpointMin Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/AutoSetpointMin/Reported +[PREFIX]/UnifyHumidityControl/Attributes/AutoSetpointMin/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster AutoSetpointMin Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "integer" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for AutoSetpointMin attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/AutoSetpointMin/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/AutoSetpointMin/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/AutoSetpointMin/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_auto_setpoint_max UnifyHumidityControl/AutoSetpointMax Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/AutoSetpointMax/Reported +[PREFIX]/UnifyHumidityControl/Attributes/AutoSetpointMax/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster AutoSetpointMax Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "integer" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for AutoSetpointMax attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/AutoSetpointMax/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/AutoSetpointMax/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/AutoSetpointMax/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_auto_setpoint UnifyHumidityControl/AutoSetpoint Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/AutoSetpoint/Reported +[PREFIX]/UnifyHumidityControl/Attributes/AutoSetpoint/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster AutoSetpoint Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "integer" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for AutoSetpoint attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/AutoSetpoint/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/AutoSetpoint/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/AutoSetpoint/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_auto_setpoint_scale UnifyHumidityControl/AutoSetpointScale Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/AutoSetpointScale/Reported +[PREFIX]/UnifyHumidityControl/Attributes/AutoSetpointScale/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster AutoSetpointScale Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "ScaleType" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for AutoSetpointScale attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/AutoSetpointScale/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/AutoSetpointScale/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/AutoSetpointScale/Reported { "value": } + +``` + +

+ +\subsection unify_humidity_control_attr_auto_setpoint_precision UnifyHumidityControl/AutoSetpointPrecision Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/AutoSetpointPrecision/Reported +[PREFIX]/UnifyHumidityControl/Attributes/AutoSetpointPrecision/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster AutoSetpointPrecision Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "integer" + } + }, + "required": [ + "value" + ] +} +``` + + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for AutoSetpointPrecision attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid/+/+/UnifyHumidityControl/Attributes/AutoSetpointPrecision/+' + +# Example output + +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/AutoSetpointPrecision/Desired { "value": } +ucl/by-unid//ep0/UnifyHumidityControl/Attributes/AutoSetpointPrecision/Reported { "value": } + +``` + +

+ + +\subsection unify_humidity_control_attr_cluster_revision UnifyHumidityControl/ClusterRevision Attribute + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Attributes/ClusterRevision/Reported +[PREFIX]/UnifyHumidityControl/Attributes/ClusterRevision/Desired +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster ClusterRevision Attribute Properties", + "type": "object", + "properties": { + "value": { + "type": "integer" + } + }, + "required": [ + "value" + ] +} +``` + +**Example Mosquitto CLI Tool Usage** + +To see desired/reported value for ClusterRevision attribute under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid///UnifyHumidityControl/Attributes/ClusterRevision/+' +# Example output +ucl/by-unid///UnifyHumidityControl/Attributes/ClusterRevision/Desired { "value": } +ucl/by-unid///UnifyHumidityControl/Attributes/ClusterRevision/Reported { "value": } +``` + + + + + +

+ + + + +\section unify_humidity_control_recv_cmd_support UnifyHumidityControl Command Support + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/SupportedCommands +[PREFIX]/UnifyHumidityControl/SupportedGeneratedCommands +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Command Support Properties", + "type": "object", + "properties": { + "value": { + "type": "array", + "items" : { + "type": "string", + "enum": [ + "ModeSet", + "SetpointSet", + "WriteAttributes", + "ForceReadAttributes" + ] + } + } + } + }, + "required": [ + "value" + ] +} +``` + +**Example Mosquitto CLI Tool Usage** + +To see supported commands for UnifyHumidityControl cluster under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid///UnifyHumidityControl/SupportedCommands' +# Example output +ucl/by-unid///UnifyHumidityControl/SupportedCommands { "value": ["ModeSet","SetpointSet","WriteAttributes", "ForceReadAttributes"] } +``` + +To see supported generated commands for UnifyHumidityControl cluster under the by-unid topic space: + +```console +mosquitto_sub -t 'ucl/by-unid///UnifyHumidityControl/SupportedGeneratedCommands' +# Example output +ucl/by-unid///UnifyHumidityControl/SupportedGeneratedCommands { "value": [] } +``` + + + + + +

+ + + + +\section unify_humidity_control_cmds UnifyHumidityControl Commands + +

+ +\subsection unify_humidity_control_mode_set_cmd UnifyHumidityControl/ModeSet Command + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Commands/ModeSet +[PREFIX]/UnifyHumidityControl/GeneratedCommands/ModeSet +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster ModeSet Command Properties", + "type": "object", + "properties": { + "Mode": { + "type": "ModeType" + } + }, + "required": [ + "Mode" + ] +} +``` + +**Example Mosquitto CLI Tool Usage** + +To send a UnifyHumidityControl/ModeSet command under the by-unid topic space: + +```console +mosquitto_pub -t 'ucl/by-unid///UnifyHumidityControl/Commands/ModeSet' -m '{ "Mode": }' +``` + +To receive a UnifyHumidityControl/ModeSet generated command from a UNID/endpoint: + +```console +mosquitto_sub -t 'ucl/by-unid///UnifyHumidityControl/GeneratedCommands/ModeSet' +``` + +

+ +\subsection unify_humidity_control_setpoint_set_cmd UnifyHumidityControl/SetpointSet Command + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Commands/SetpointSet +[PREFIX]/UnifyHumidityControl/GeneratedCommands/SetpointSet +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster SetpointSet Command Properties", + "type": "object", + "properties": { + "Type": { + "type": "SetpointType" + }, + "Precision": { + "type": "integer" + }, + "Scale": { + "type": "integer" + }, + "Value": { + "type": "integer" + } + }, + "required": [ + "Type", + "Precision", + "Scale", + "Value" + ] +} +``` + +**Example Mosquitto CLI Tool Usage** + +To send a UnifyHumidityControl/SetpointSet command under the by-unid topic space: + +```console +mosquitto_pub -t 'ucl/by-unid///UnifyHumidityControl/Commands/SetpointSet' -m '{ "Type": ,"Precision": ,"Scale": ,"Value": }' +``` + +To receive a UnifyHumidityControl/SetpointSet generated command from a UNID/endpoint: + +```console +mosquitto_sub -t 'ucl/by-unid///UnifyHumidityControl/GeneratedCommands/SetpointSet' +``` + +

+ +\subsection unify_humidity_control_write_attr_cmd UnifyHumidityControl/WriteAttributes Command + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Commands/WriteAttributes +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster WriteAttributes Command Properties", + "type": "object", + "properties": { + "ReportingMode": { + "type": "ModeType" + }, + }, + "required": [ + "value" + ] +} +``` + +**Example Mosquitto CLI Tool Usage** + +To update all UnifyHumidityControl attributes under the by-unid topic space: + +```console +mosquitto_pub -t 'ucl/by-unid///UnifyHumidityControl/Commands/WriteAttributes' -m '{ "ReportingMode": , }' +``` + +> NOTE: Specify only the list of attributes to write in this command. +> Unspecified attributes will not be updated. + +

+ +\subsection unify_humidity_control_force_read_attr_cmd UnifyHumidityControl/ForceReadAttributes Command + +**MQTT Topic Pattern:** + +``` +[PREFIX]/UnifyHumidityControl/Commands/ForceReadAttributes +``` + +**MQTT Payload JSON Schema:** + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControl Cluster ForceReadAttributes Command Properties", + "type": "object", + "properties": { + "value": { + "type": "array" + "items": { + "type": "string", + "enum": [ + "ReportingMode", + "SupportedReportingMode", + "CurrentState", + "SupportedSetPoints", + "HumidifierSetpointMin", + "HumidifierSetpointMax", + "HumidifierSetpoint", + "HumidifierSetpointScale", + "HumidifierSetpointPrecision", + "DehumidifierSetpointMin", + "DehumidifierSetpointMax", + "DehumidifierSetpoint", + "DehumidifierSetpointScale", + "DehumidifierSetpointPrecision", + "AutoSetpointMin", + "AutoSetpointMax", + "AutoSetpoint", + "AutoSetpointScale", + "AutoSetpointPrecision" + ] + } + } + }, + "required": [ + "value" + ] +} +``` + +**Example Mosquitto CLI Tool Usage** + +To force read all UnifyHumidityControl attributes under the by-unid topic space (by sending an empty array): + +```console +mosquitto_pub -t 'ucl/by-unid///UnifyHumidityControl/Commands/ForceReadAttributes' -m '{ "value": [] }' +``` + +To force read one of the UnifyHumidityControl attributes under the by-unid topic space: + +```console +mosquitto_pub -t 'ucl/by-unid///UnifyHumidityControl/Commands/ForceReadAttributes' -m '{ "value": ["ReportingMode"] }' +``` + + + + +


@@ -56478,6 +57657,31 @@ mosquitto_pub -t 'ucl/by-unid///Descriptor/Commands/ForceReadAttribute

+ + + +\section enum_mode_type ModeType Enum + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModeType Enum Properties", + "type": "string", + "enum": [ + "Off", + "Humidify", + "Dehumidify", + "Auto" + ] +} +``` + + + + + +

+ @@ -56975,6 +58179,29 @@ mosquitto_pub -t 'ucl/by-unid///Descriptor/Commands/ForceReadAttribute

+ + + +\section enum_scale_type ScaleType Enum + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ScaleType Enum Properties", + "type": "string", + "enum": [ + "Percentage", + "Absolute" + ] +} +``` + + + + + +

+ @@ -56999,6 +58226,30 @@ mosquitto_pub -t 'ucl/by-unid///Descriptor/Commands/ForceReadAttribute

+ + + +\section enum_setpoint_type SetpointType Enum + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SetpointType Enum Properties", + "type": "string", + "enum": [ + "Humidifier", + "Dehumidifier", + "Auto" + ] +} +``` + + + + + +

+ @@ -57545,6 +58796,30 @@ mosquitto_pub -t 'ucl/by-unid///Descriptor/Commands/ForceReadAttribute

+ + + +\section enum_unify_humidity_control_current_state UnifyHumidityControlCurrentState Enum + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControlCurrentState Enum Properties", + "type": "string", + "enum": [ + "Idle", + "Humidifying", + "Dehumidifying" + ] +} +``` + + + + + +

+ @@ -59947,6 +61222,66 @@ mosquitto_pub -t 'ucl/by-unid///Descriptor/Commands/ForceReadAttribute

+ + + +\section enum_unify_humidity_control_supported_reporting_mode UnifyHumidityControlSupportedReportingMode Bitmap + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControlSupportedReportingMode Enum Properties", + "type": "object", + "properties": { + "Humidify": { + "type": "boolean" + }, + "Dehumidify": { + "type": "boolean" + }, + "Auto": { + "type": "boolean" + } + } +} +``` + + + + + +

+ + + + +\section enum_unify_humidity_control_supported_set_points UnifyHumidityControlSupportedSetPoints Bitmap + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnifyHumidityControlSupportedSetPoints Enum Properties", + "type": "object", + "properties": { + "Humidifier": { + "type": "boolean" + }, + "Dehumidifier": { + "type": "boolean" + }, + "Auto": { + "type": "boolean" + } + } +} +``` + + + + + +

+ diff --git a/components/uic_dotdot/zap-generated/src/dotdot_attribute_id_definitions.c b/components/uic_dotdot/zap-generated/src/dotdot_attribute_id_definitions.c index cd3e175e6..33b0e2b6e 100644 --- a/components/uic_dotdot/zap-generated/src/dotdot_attribute_id_definitions.c +++ b/components/uic_dotdot/zap-generated/src/dotdot_attribute_id_definitions.c @@ -2025,6 +2025,53 @@ const char *uic_dotdot_get_attribute_name(dotdot_cluster_id_t cluster_id, return "Unknown"; } // clang-format off + case DOTDOT_UNIFY_HUMIDITY_CONTROL_CLUSTER_ID: + // clang-format on + switch (attribute_id) { + // clang-format off + case DOTDOT_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE_ATTRIBUTE_ID: + return "ReportingMode"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE_ATTRIBUTE_ID: + return "SupportedReportingMode"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE_ATTRIBUTE_ID: + return "CurrentState"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS_ATTRIBUTE_ID: + return "SupportedSetPoints"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN_ATTRIBUTE_ID: + return "HumidifierSetpointMin"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX_ATTRIBUTE_ID: + return "HumidifierSetpointMax"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_ATTRIBUTE_ID: + return "HumidifierSetpoint"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE_ATTRIBUTE_ID: + return "HumidifierSetpointScale"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION_ATTRIBUTE_ID: + return "HumidifierSetpointPrecision"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN_ATTRIBUTE_ID: + return "DehumidifierSetpointMin"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX_ATTRIBUTE_ID: + return "DehumidifierSetpointMax"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_ATTRIBUTE_ID: + return "DehumidifierSetpoint"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE_ATTRIBUTE_ID: + return "DehumidifierSetpointScale"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION_ATTRIBUTE_ID: + return "DehumidifierSetpointPrecision"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN_ATTRIBUTE_ID: + return "AutoSetpointMin"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX_ATTRIBUTE_ID: + return "AutoSetpointMax"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_ATTRIBUTE_ID: + return "AutoSetpoint"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE_ATTRIBUTE_ID: + return "AutoSetpointScale"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION_ATTRIBUTE_ID: + return "AutoSetpointPrecision"; + // clang-format on + default: + return "Unknown"; + } + // clang-format off // clang-format on default: return "Unknown"; @@ -4409,6 +4456,65 @@ dotdot_attribute_id_t return DOTDOT_DESCRIPTOR_DEVICE_TYPE_LIST_ATTRIBUTE_ID; } break; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_CLUSTER_ID: + if (strcmp ("ReportingMode", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE_ATTRIBUTE_ID; + } + if (strcmp ("SupportedReportingMode", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE_ATTRIBUTE_ID; + } + if (strcmp ("CurrentState", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE_ATTRIBUTE_ID; + } + if (strcmp ("SupportedSetPoints", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS_ATTRIBUTE_ID; + } + if (strcmp ("HumidifierSetpointMin", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN_ATTRIBUTE_ID; + } + if (strcmp ("HumidifierSetpointMax", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX_ATTRIBUTE_ID; + } + if (strcmp ("HumidifierSetpoint", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_ATTRIBUTE_ID; + } + if (strcmp ("HumidifierSetpointScale", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE_ATTRIBUTE_ID; + } + if (strcmp ("HumidifierSetpointPrecision", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION_ATTRIBUTE_ID; + } + if (strcmp ("DehumidifierSetpointMin", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN_ATTRIBUTE_ID; + } + if (strcmp ("DehumidifierSetpointMax", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX_ATTRIBUTE_ID; + } + if (strcmp ("DehumidifierSetpoint", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_ATTRIBUTE_ID; + } + if (strcmp ("DehumidifierSetpointScale", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE_ATTRIBUTE_ID; + } + if (strcmp ("DehumidifierSetpointPrecision", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION_ATTRIBUTE_ID; + } + if (strcmp ("AutoSetpointMin", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN_ATTRIBUTE_ID; + } + if (strcmp ("AutoSetpointMax", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX_ATTRIBUTE_ID; + } + if (strcmp ("AutoSetpoint", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_ATTRIBUTE_ID; + } + if (strcmp ("AutoSetpointScale", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE_ATTRIBUTE_ID; + } + if (strcmp ("AutoSetpointPrecision", attribute_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION_ATTRIBUTE_ID; + } + break; default: return DOTDOT_INVALID_ATTRIBUTE_ID; } @@ -6426,6 +6532,53 @@ dotdot_attribute_json_type_t return JSON_TYPE_UNKNOWN; } // clang-format off + case DOTDOT_UNIFY_HUMIDITY_CONTROL_CLUSTER_ID: + // clang-format on + switch (attribute_id) { + // clang-format off + case DOTDOT_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION_ATTRIBUTE_ID: + return JSON_TYPE_NUMBER; + // clang-format on + default: + return JSON_TYPE_UNKNOWN; + } + // clang-format off // clang-format on default: return JSON_TYPE_UNKNOWN; @@ -6774,5 +6927,23 @@ bool uic_dotdot_attribute_is_enum(dotdot_cluster_id_t cluster_id, if (64787 == cluster_id) { } + if (64928 == cluster_id) { + if (1 == attribute_id) { + return true; + } + if (3 == attribute_id) { + return true; + } + if (8 == attribute_id) { + return true; + } + if (13 == attribute_id) { + return true; + } + if (18 == attribute_id) { + return true; + } + } + return false; } diff --git a/components/uic_dotdot/zap-generated/src/dotdot_cluster_id_definitions.c b/components/uic_dotdot/zap-generated/src/dotdot_cluster_id_definitions.c index 18b5402fa..b4ed6aad6 100644 --- a/components/uic_dotdot/zap-generated/src/dotdot_cluster_id_definitions.c +++ b/components/uic_dotdot/zap-generated/src/dotdot_cluster_id_definitions.c @@ -128,6 +128,8 @@ const char* uic_dotdot_get_cluster_name(dotdot_cluster_id_t cluster_id) { return "ProtocolController-NetworkManagement"; case DOTDOT_DESCRIPTOR_CLUSTER_ID: return "Descriptor"; + case DOTDOT_UNIFY_HUMIDITY_CONTROL_CLUSTER_ID: + return "UnifyHumidityControl"; default: return "Unknown"; } @@ -299,6 +301,9 @@ dotdot_cluster_id_t uic_dotdot_get_cluster_id(const char* cluster_name) { if (strcmp ("Descriptor", cluster_name) == 0) { return DOTDOT_DESCRIPTOR_CLUSTER_ID; } + if (strcmp ("UnifyHumidityControl", cluster_name) == 0) { + return DOTDOT_UNIFY_HUMIDITY_CONTROL_CLUSTER_ID; + } // Return an invalid ID if we did not get any match. return DOTDOT_INVALID_CLUSTER_ID; diff --git a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt.h b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt.h index f0dc62b09..c228ec95a 100644 --- a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt.h +++ b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt.h @@ -40444,6 +40444,853 @@ void uic_mqtt_dotdot_descriptor_publish_supported_commands( void uic_mqtt_dotdot_descriptor_publish_empty_supported_commands( const dotdot_unid_t unid ,dotdot_endpoint_id_t endpoint); +// Callback types used by the unify_humidity_control cluster +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + uic_mqtt_dotdot_callback_call_type_t call_type, + ModeType mode + +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + uic_mqtt_dotdot_callback_call_type_t call_type, + SetpointType type, + + uint8_t precision, + + uint8_t scale, + + int32_t value + +); + +typedef struct { + uint8_t reporting_mode; + uint8_t supported_reporting_mode; + uint8_t current_state; + uint8_t supported_set_points; + int32_t humidifier_setpoint_min; + int32_t humidifier_setpoint_max; + int32_t humidifier_setpoint; + uint8_t humidifier_setpoint_scale; + uint8_t humidifier_setpoint_precision; + int32_t dehumidifier_setpoint_min; + int32_t dehumidifier_setpoint_max; + int32_t dehumidifier_setpoint; + uint8_t dehumidifier_setpoint_scale; + uint8_t dehumidifier_setpoint_precision; + int32_t auto_setpoint_min; + int32_t auto_setpoint_max; + int32_t auto_setpoint; + uint8_t auto_setpoint_scale; + uint8_t auto_setpoint_precision; +} uic_mqtt_dotdot_unify_humidity_control_state_t; + +typedef struct { + bool reporting_mode; + bool supported_reporting_mode; + bool current_state; + bool supported_set_points; + bool humidifier_setpoint_min; + bool humidifier_setpoint_max; + bool humidifier_setpoint; + bool humidifier_setpoint_scale; + bool humidifier_setpoint_precision; + bool dehumidifier_setpoint_min; + bool dehumidifier_setpoint_max; + bool dehumidifier_setpoint; + bool dehumidifier_setpoint_scale; + bool dehumidifier_setpoint_precision; + bool auto_setpoint_min; + bool auto_setpoint_max; + bool auto_setpoint; + bool auto_setpoint_scale; + bool auto_setpoint_precision; +} uic_mqtt_dotdot_unify_humidity_control_updated_state_t; + +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback_t)( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint, + uic_mqtt_dotdot_callback_call_type_t call_type, + uic_mqtt_dotdot_unify_humidity_control_state_t, + uic_mqtt_dotdot_unify_humidity_control_updated_state_t +); + +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback_t)( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint, + uic_mqtt_dotdot_callback_call_type_t call_type, + uic_mqtt_dotdot_unify_humidity_control_updated_state_t +); + + +/** + * @brief Command fields for UnifyHumidityControl/ModeSet + */ +typedef struct { + ModeType mode; +} uic_mqtt_dotdot_unify_humidity_control_command_mode_set_fields_t; + +/** + * @brief Command fields for UnifyHumidityControl/SetpointSet + */ +typedef struct { + SetpointType type; + + uint8_t precision; + + uint8_t scale; + + int32_t value; +} uic_mqtt_dotdot_unify_humidity_control_command_setpoint_set_fields_t; + + +/** + * @brief Setup callback to be called when a + * UnifyHumidityControl/Commands/mode_set is received. + * + * Setting this callback will not overwrite the previous set callback + * @param callback Function to be called on command reception + */ +void uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_set(const uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_t callback); +/** + * @brief Unsets callback to be called when a + * UnifyHumidityControl/Commands/mode_set is received. + * + * @param callback Function to be no longer called on command reception + */ +void uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_unset(const uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_t callback); +/** + * @brief Clears all callbacks registered for when + * UnifyHumidityControl/Commands/mode_set is received. + */ +void uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_clear(); + +/** + * @brief Setup callback to be called when a + * +/UnifyHumidityControl/GeneratedCommands/mode_set is received. + * + * Setting this callback will not overwrite the previous set callback + * @param callback Function to be called on command reception + */ +void uic_mqtt_dotdot_unify_humidity_control_generated_mode_set_callback_set(const uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_t callback); +/** + * @brief Unsets callback to be called when a + * +/UnifyHumidityControl/GeneratedCommands/mode_set is received. + * @param callback Function to be no longer called on command reception + */ +void uic_mqtt_dotdot_unify_humidity_control_generated_mode_set_callback_unset(const uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_t callback); +/** + * @brief Clears all callbacks registered for when + * +/UnifyHumidityControl/GeneratedCommands/mode_set is received. + */ +void uic_mqtt_dotdot_unify_humidity_control_generated_mode_set_callback_clear(); +/** + * @brief Setup callback to be called when a + * UnifyHumidityControl/Commands/setpoint_set is received. + * + * Setting this callback will not overwrite the previous set callback + * @param callback Function to be called on command reception + */ +void uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_set(const uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_t callback); +/** + * @brief Unsets callback to be called when a + * UnifyHumidityControl/Commands/setpoint_set is received. + * + * @param callback Function to be no longer called on command reception + */ +void uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_unset(const uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_t callback); +/** + * @brief Clears all callbacks registered for when + * UnifyHumidityControl/Commands/setpoint_set is received. + */ +void uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_clear(); + +/** + * @brief Setup callback to be called when a + * +/UnifyHumidityControl/GeneratedCommands/setpoint_set is received. + * + * Setting this callback will not overwrite the previous set callback + * @param callback Function to be called on command reception + */ +void uic_mqtt_dotdot_unify_humidity_control_generated_setpoint_set_callback_set(const uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_t callback); +/** + * @brief Unsets callback to be called when a + * +/UnifyHumidityControl/GeneratedCommands/setpoint_set is received. + * @param callback Function to be no longer called on command reception + */ +void uic_mqtt_dotdot_unify_humidity_control_generated_setpoint_set_callback_unset(const uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_t callback); +/** + * @brief Clears all callbacks registered for when + * +/UnifyHumidityControl/GeneratedCommands/setpoint_set is received. + */ +void uic_mqtt_dotdot_unify_humidity_control_generated_setpoint_set_callback_clear(); + +/** + * @brief Setup a callback for WriteAttribute to be called when a + * +/unify_humidity_control/Commands/WriteAttributes is received. + * + * Setting this callback will not overwrite the previous set callback + * @param callback Function to be called on command reception + */ +void uic_mqtt_dotdot_set_unify_humidity_control_write_attributes_callback( + const uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback_t callback +); +/** + * @brief Unsets a callback for WriteAttribute to be called when a + * +/unify_humidity_control/Commands/WriteAttributes is received. + * @param callback Function to be no longer called on command reception + */ +void uic_mqtt_dotdot_unset_unify_humidity_control_write_attributes_callback( + const uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback_t callback +); +/** + * @brief Clears all callbacks registered for when + * +/unify_humidity_control/Commands/WriteAttributes is received. + */ +void uic_mqtt_dotdot_clear_unify_humidity_control_write_attributes_callbacks(); + +/** + * @brief Setup a callback for ForceReadAttributes to be called when a + * +/unify_humidity_control/Commands/ForceReadAttributes is received. + * + * Setting this callback will not overwrite the previous set callback + * @param callback Function to be called on command reception + */ +void uic_mqtt_dotdot_set_unify_humidity_control_force_read_attributes_callback( + const uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback_t callback +); +/** + * @brief Unsets a callback for ForceReadAttributes to be called when a + * +/unify_humidity_control/Commands/ForceReadAttributes is received. + * + * @param callback Function to be no longer called on command reception + */ +void uic_mqtt_dotdot_unset_unify_humidity_control_force_read_attributes_callback( + const uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback_t callback +); +/** + * @brief Clears all callbacks registered for when + * +/unify_humidity_control/Commands/ForceReadAttributes is received. + */ +void uic_mqtt_dotdot_clear_unify_humidity_control_force_read_attributes_callbacks(); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/ReportingMode + * + * @param base_topic topic prefix to publish, /reporting_mode + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_reporting_mode_publish( + const char *base_topic, + ModeType value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/ReportingMode + * + * @param base_topic topic prefix to publish, /reporting_mode + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_reporting_mode_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/SupportedReportingMode + * + * @param base_topic topic prefix to publish, /supported_reporting_mode + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_supported_reporting_mode_publish( + const char *base_topic, + uint8_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/SupportedReportingMode + * + * @param base_topic topic prefix to publish, /supported_reporting_mode + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_supported_reporting_mode_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/CurrentState + * + * @param base_topic topic prefix to publish, /current_state + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_current_state_publish( + const char *base_topic, + uint8_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/CurrentState + * + * @param base_topic topic prefix to publish, /current_state + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_current_state_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/SupportedSetPoints + * + * @param base_topic topic prefix to publish, /supported_set_points + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_supported_set_points_publish( + const char *base_topic, + uint8_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/SupportedSetPoints + * + * @param base_topic topic prefix to publish, /supported_set_points + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_supported_set_points_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/HumidifierSetpointMin + * + * @param base_topic topic prefix to publish, /humidifier_setpoint_min + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_min_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/HumidifierSetpointMin + * + * @param base_topic topic prefix to publish, /humidifier_setpoint_min + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_min_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/HumidifierSetpointMax + * + * @param base_topic topic prefix to publish, /humidifier_setpoint_max + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_max_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/HumidifierSetpointMax + * + * @param base_topic topic prefix to publish, /humidifier_setpoint_max + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_max_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/HumidifierSetpoint + * + * @param base_topic topic prefix to publish, /humidifier_setpoint + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/HumidifierSetpoint + * + * @param base_topic topic prefix to publish, /humidifier_setpoint + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/HumidifierSetpointScale + * + * @param base_topic topic prefix to publish, /humidifier_setpoint_scale + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_scale_publish( + const char *base_topic, + ScaleType value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/HumidifierSetpointScale + * + * @param base_topic topic prefix to publish, /humidifier_setpoint_scale + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_scale_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/HumidifierSetpointPrecision + * + * @param base_topic topic prefix to publish, /humidifier_setpoint_precision + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_precision_publish( + const char *base_topic, + uint8_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/HumidifierSetpointPrecision + * + * @param base_topic topic prefix to publish, /humidifier_setpoint_precision + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_precision_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/DehumidifierSetpointMin + * + * @param base_topic topic prefix to publish, /dehumidifier_setpoint_min + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_min_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/DehumidifierSetpointMin + * + * @param base_topic topic prefix to publish, /dehumidifier_setpoint_min + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_min_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/DehumidifierSetpointMax + * + * @param base_topic topic prefix to publish, /dehumidifier_setpoint_max + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_max_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/DehumidifierSetpointMax + * + * @param base_topic topic prefix to publish, /dehumidifier_setpoint_max + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_max_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/DehumidifierSetpoint + * + * @param base_topic topic prefix to publish, /dehumidifier_setpoint + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/DehumidifierSetpoint + * + * @param base_topic topic prefix to publish, /dehumidifier_setpoint + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/DehumidifierSetpointScale + * + * @param base_topic topic prefix to publish, /dehumidifier_setpoint_scale + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_scale_publish( + const char *base_topic, + ScaleType value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/DehumidifierSetpointScale + * + * @param base_topic topic prefix to publish, /dehumidifier_setpoint_scale + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_scale_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/DehumidifierSetpointPrecision + * + * @param base_topic topic prefix to publish, /dehumidifier_setpoint_precision + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_precision_publish( + const char *base_topic, + uint8_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/DehumidifierSetpointPrecision + * + * @param base_topic topic prefix to publish, /dehumidifier_setpoint_precision + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_precision_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/AutoSetpointMin + * + * @param base_topic topic prefix to publish, /auto_setpoint_min + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_min_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/AutoSetpointMin + * + * @param base_topic topic prefix to publish, /auto_setpoint_min + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_min_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/AutoSetpointMax + * + * @param base_topic topic prefix to publish, /auto_setpoint_max + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_max_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/AutoSetpointMax + * + * @param base_topic topic prefix to publish, /auto_setpoint_max + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_max_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/AutoSetpoint + * + * @param base_topic topic prefix to publish, /auto_setpoint + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/AutoSetpoint + * + * @param base_topic topic prefix to publish, /auto_setpoint + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/AutoSetpointScale + * + * @param base_topic topic prefix to publish, /auto_setpoint_scale + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_scale_publish( + const char *base_topic, + ScaleType value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/AutoSetpointScale + * + * @param base_topic topic prefix to publish, /auto_setpoint_scale + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_scale_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Publish the attribute; UnifyHumidityControl/Attributes/AutoSetpointPrecision + * + * @param base_topic topic prefix to publish, /auto_setpoint_precision + * will be appended + * @param value Value to publish + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_precision_publish( + const char *base_topic, + uint8_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + +/** + * @brief Unretains a published attribute; UnifyHumidityControl/Attributes/AutoSetpointPrecision + * + * @param base_topic topic prefix to publish, /auto_setpoint_precision + * will be appended + * @param publish_type Whether to publish as Desired, Reported, or Both. + * + * @returns SL_STATUS_OK on success + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_precision_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +); + + +/** + * @brief Publish the UnifyHumidityControl/ClusterRevision attribute + * + * @param base_topic topic prefix to publish, /UnifyHumidityControl/Attributes/ClusterRevision + * will be appended. + * @param value Value to publish. + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_cluster_revision(const char* base_topic, uint16_t value); + +/** + * @brief Unretain a publication to UnifyHumidityControl/ClusterRevision attribute + * + * @param base_topic topic prefix to publish, /UnifyHumidityControl/Attributes/ClusterRevision + * will be appended. + */ +void uic_mqtt_dotdot_unify_humidity_control_unretain_cluster_revision(const char* base_topic); + +/** + * @brief Publish the SupportedCommands for UNID/EndPoint for the UnifyHumidityControl Cluster + * + * This function will iterate over all Commands in the UnifyHumidityControl Cluster and + * call all registered callback functions with UNID/endpoint, and + * callback_type = UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK. + * All Cluster Command callback functions that return SL_STATUS_OK + * will be added to the list of supported commands and published. + * + * @param unid + * @param endpoint + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_supported_commands( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint); + +/** + * @brief Publish an empty array of SupportedCommands for UNID/EndPoint for + * the UnifyHumidityControl Cluster + * + * @param unid + * @param endpoint ) + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_empty_supported_commands( + const dotdot_unid_t unid + ,dotdot_endpoint_id_t endpoint); /** * @brief Publish the SupportedCommands for UNID/EndPoint diff --git a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_attributes.h b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_attributes.h index 92daf48a2..33a8a8f4d 100644 --- a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_attributes.h +++ b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_attributes.h @@ -5134,6 +5134,140 @@ typedef sl_status_t (*uic_mqtt_dotdot_descriptor_attribute_device_type_list_call size_t device_type_list_count, const DeviceTypeStruct* device_type_list ); +// Callback types used by the unify_humidity_control cluster +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_reporting_mode_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + uint8_t reporting_mode +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_supported_reporting_mode_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + uint8_t supported_reporting_mode +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_current_state_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + uint8_t current_state +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_supported_set_points_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + uint8_t supported_set_points +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_min_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + int32_t humidifier_setpoint_min +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_max_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + int32_t humidifier_setpoint_max +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + int32_t humidifier_setpoint +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_scale_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + uint8_t humidifier_setpoint_scale +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_precision_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + uint8_t humidifier_setpoint_precision +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_min_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + int32_t dehumidifier_setpoint_min +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_max_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + int32_t dehumidifier_setpoint_max +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + int32_t dehumidifier_setpoint +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_scale_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + uint8_t dehumidifier_setpoint_scale +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_precision_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + uint8_t dehumidifier_setpoint_precision +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_min_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + int32_t auto_setpoint_min +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_max_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + int32_t auto_setpoint_max +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + int32_t auto_setpoint +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_scale_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + uint8_t auto_setpoint_scale +); +typedef sl_status_t (*uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_precision_callback_t)( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + bool unretained, + uic_mqtt_dotdot_attribute_update_type_t update_type, + uint8_t auto_setpoint_precision +); #ifdef __cplusplus extern "C" { @@ -9858,6 +9992,128 @@ sl_status_t uic_mqtt_dotdot_descriptor_attributes_init(); void uic_mqtt_dotdot_descriptor_attribute_device_type_list_callback_set(const uic_mqtt_dotdot_descriptor_attribute_device_type_list_callback_t callback); +/** + * Initializes the attributes features for the UnifyHumidityControl cluster, + * allowing to receive attribute updates from other UNIDs. + */ +sl_status_t uic_mqtt_dotdot_unify_humidity_control_attributes_init(); + +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/reporting_mode/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_reporting_mode_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_reporting_mode_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/supported_reporting_mode/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_supported_reporting_mode_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_supported_reporting_mode_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/current_state/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_current_state_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_current_state_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/supported_set_points/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_supported_set_points_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_supported_set_points_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/humidifier_setpoint_min/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_min_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_min_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/humidifier_setpoint_max/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_max_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_max_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/humidifier_setpoint/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/humidifier_setpoint_scale/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_scale_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_scale_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/humidifier_setpoint_precision/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_precision_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_precision_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/dehumidifier_setpoint_min/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_min_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_min_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/dehumidifier_setpoint_max/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_max_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_max_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/dehumidifier_setpoint/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/dehumidifier_setpoint_scale/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_scale_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_scale_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/dehumidifier_setpoint_precision/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_precision_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_precision_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/auto_setpoint_min/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_min_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_min_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/auto_setpoint_max/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_max_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_max_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/auto_setpoint/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/auto_setpoint_scale/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_scale_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_scale_callback_t callback); +/** + * Setup callback to be called when a + * UnifyHumidityControl/Attributes/auto_setpoint_precision/# is received. Setting + * this callback will overwrite the previous set callback + */ +void uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_precision_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_precision_callback_t callback); + + #ifdef __cplusplus } #endif // __cplusplus diff --git a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_generated_commands.h b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_generated_commands.h index 16d97617d..7fb6c674c 100644 --- a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_generated_commands.h +++ b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_generated_commands.h @@ -4986,6 +4986,70 @@ void uic_mqtt_dotdot_descriptor_publish_generated_write_attributes_command( uic_mqtt_dotdot_descriptor_updated_state_t attribute_list ); +/** + * @brief Publishes an incoming/generated ModeSet command for + * the UnifyHumidityControl cluster. + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/GeneratedCommands/ModeSet + * + * @param unid The UNID of the node that sent us the command. + * + * @param endpoint The Endpoint ID of the node that sent us the command. + * + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_generated_mode_set_command( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint, + const uic_mqtt_dotdot_unify_humidity_control_command_mode_set_fields_t *fields + +); +/** + * @brief Publishes an incoming/generated SetpointSet command for + * the UnifyHumidityControl cluster. + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/GeneratedCommands/SetpointSet + * + * @param unid The UNID of the node that sent us the command. + * + * @param endpoint The Endpoint ID of the node that sent us the command. + * + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_generated_setpoint_set_command( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint, + const uic_mqtt_dotdot_unify_humidity_control_command_setpoint_set_fields_t *fields + +); + +/** + * @brief Publishes an incoming/generated WriteAttributes command for + * the UnifyHumidityControl cluster. + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/GeneratedCommands/WriteAttributes + * + * @param unid The UNID of the node that sent us the command. + * + * @param endpoint The Endpoint ID of the node that sent us the command. + * + * @param attribute_values Values to assign to the attributes + * @param attribute_list List of attributes that are written + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_generated_write_attributes_command( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint, + uic_mqtt_dotdot_unify_humidity_control_state_t attribute_values, + uic_mqtt_dotdot_unify_humidity_control_updated_state_t attribute_list +); + #ifdef __cplusplus } diff --git a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_group_commands.h b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_group_commands.h index a5c1d17ef..1d7931b46 100644 --- a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_group_commands.h +++ b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_group_commands.h @@ -3709,6 +3709,55 @@ void uic_mqtt_dotdot_by_group_descriptor_write_attributes_callback_set( +/** + * @brief Callback signature for by-group UnifyHumidityControl::ModeSet command. + */ +typedef void (*uic_mqtt_dotdot_by_group_unify_humidity_control_mode_set_callback_t)( + const dotdot_group_id_t group_id, + const uic_mqtt_dotdot_unify_humidity_control_command_mode_set_fields_t *fields +); + +/** + * Setup handler to be called when a + * ucl/by-group/+/UnifyHumidityControl/mode_set is received. + * Setting this callback will overwrite the previous set callback. + * + */ +void uic_mqtt_dotdot_by_group_unify_humidity_control_mode_set_callback_set(const uic_mqtt_dotdot_by_group_unify_humidity_control_mode_set_callback_t callback); + +/** + * @brief Callback signature for by-group UnifyHumidityControl::SetpointSet command. + */ +typedef void (*uic_mqtt_dotdot_by_group_unify_humidity_control_setpoint_set_callback_t)( + const dotdot_group_id_t group_id, + const uic_mqtt_dotdot_unify_humidity_control_command_setpoint_set_fields_t *fields +); + +/** + * Setup handler to be called when a + * ucl/by-group/+/UnifyHumidityControl/setpoint_set is received. + * Setting this callback will overwrite the previous set callback. + * + */ +void uic_mqtt_dotdot_by_group_unify_humidity_control_setpoint_set_callback_set(const uic_mqtt_dotdot_by_group_unify_humidity_control_setpoint_set_callback_t callback); + +typedef void (*uic_mqtt_dotdot_by_group_unify_humidity_control_write_attributes_callback_t)( + const dotdot_group_id_t group_id, + uic_mqtt_dotdot_unify_humidity_control_state_t, + uic_mqtt_dotdot_unify_humidity_control_updated_state_t +); + +/** + * Setup a callback for WriteAttribute to be called when a + * ucl/by-group/+/unify_humidity_control/Commands/WriteAttributes is received. + * Setting this callback will overwrite any previously set callback. + */ +void uic_mqtt_dotdot_by_group_unify_humidity_control_write_attributes_callback_set( + const uic_mqtt_dotdot_by_group_unify_humidity_control_write_attributes_callback_t callback +); + + + #ifdef __cplusplus } #endif // __cplusplus diff --git a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_helpers.h b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_helpers.h index dcc29ad5f..79335ba6d 100644 --- a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_helpers.h +++ b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_helpers.h @@ -517,6 +517,13 @@ char *metering_unitof_measure_get_enum_value_name_c( uint32_t value, char *result, size_t max_result_size); /** Get metering_unitof_measure enum representation from string. */ uint32_t metering_unitof_measure_get_enum_value_number_c(const char *str); +#define MODE_TYPE_ENUM_NAME_AVAILABLE 1 + +/** Get mode_type string representation from enum. */ +char *mode_type_get_enum_value_name_c( + uint32_t value, char *result, size_t max_result_size); +/** Get mode_type enum representation from string. */ +uint32_t mode_type_get_enum_value_number_c(const char *str); #define MOVE_STEP_MODE_ENUM_NAME_AVAILABLE 1 /** Get move_step_mode string representation from enum. */ @@ -650,6 +657,13 @@ char *shdcfg_direction_get_enum_value_name_c( uint32_t value, char *result, size_t max_result_size); /** Get shdcfg_direction enum representation from string. */ uint32_t shdcfg_direction_get_enum_value_number_c(const char *str); +#define SCALE_TYPE_ENUM_NAME_AVAILABLE 1 + +/** Get scale_type string representation from enum. */ +char *scale_type_get_enum_value_name_c( + uint32_t value, char *result, size_t max_result_size); +/** Get scale_type enum representation from string. */ +uint32_t scale_type_get_enum_value_number_c(const char *str); #define SETPOINT_RAISE_OR_LOWER_MODE_ENUM_NAME_AVAILABLE 1 /** Get setpoint_raise_or_lower_mode string representation from enum. */ @@ -657,6 +671,13 @@ char *setpoint_raise_or_lower_mode_get_enum_value_name_c( uint32_t value, char *result, size_t max_result_size); /** Get setpoint_raise_or_lower_mode enum representation from string. */ uint32_t setpoint_raise_or_lower_mode_get_enum_value_number_c(const char *str); +#define SETPOINT_TYPE_ENUM_NAME_AVAILABLE 1 + +/** Get setpoint_type string representation from enum. */ +char *setpoint_type_get_enum_value_name_c( + uint32_t value, char *result, size_t max_result_size); +/** Get setpoint_type enum representation from string. */ +uint32_t setpoint_type_get_enum_value_number_c(const char *str); #define SHADE_CONFIGURATION_MODE_ENUM_NAME_AVAILABLE 1 /** Get shade_configuration_mode string representation from enum. */ @@ -811,6 +832,13 @@ char *tx_report_transmission_speed_get_enum_value_name_c( uint32_t value, char *result, size_t max_result_size); /** Get tx_report_transmission_speed enum representation from string. */ uint32_t tx_report_transmission_speed_get_enum_value_number_c(const char *str); +#define UNIFY_HUMIDITY_CONTROL_CURRENT_STATE_ENUM_NAME_AVAILABLE 1 + +/** Get unify_humidity_control_current_state string representation from enum. */ +char *unify_humidity_control_current_state_get_enum_value_name_c( + uint32_t value, char *result, size_t max_result_size); +/** Get unify_humidity_control_current_state enum representation from string. */ +uint32_t unify_humidity_control_current_state_get_enum_value_number_c(const char *str); #define WINDOW_COVERING_WINDOW_COVERING_TYPE_ENUM_NAME_AVAILABLE 1 /** Get window_covering_window_covering_type string representation from enum. */ diff --git a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_helpers.hpp b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_helpers.hpp index 8db91a511..b129eb876 100644 --- a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_helpers.hpp +++ b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_helpers.hpp @@ -1220,6 +1220,23 @@ std::string metering_unitof_measure_get_enum_value_name( */ uint32_t metering_unitof_measure_get_enum_value_number(const std::string &str); +#define MODE_TYPE_ENUM_NAME_AVAILABLE 1 + +/** + * @brief Finds the name of a field for the ModeType enum + * + * @returns A string representation of the value. + */ +std::string mode_type_get_enum_value_name( + uint32_t value); + +/** + * @brief Finds the enum number of a string representation for the ModeType enum + * + * @returns A number enum value. + */ +uint32_t mode_type_get_enum_value_number(const std::string &str); + #define MOVE_STEP_MODE_ENUM_NAME_AVAILABLE 1 /** @@ -1543,6 +1560,23 @@ std::string shdcfg_direction_get_enum_value_name( */ uint32_t shdcfg_direction_get_enum_value_number(const std::string &str); +#define SCALE_TYPE_ENUM_NAME_AVAILABLE 1 + +/** + * @brief Finds the name of a field for the ScaleType enum + * + * @returns A string representation of the value. + */ +std::string scale_type_get_enum_value_name( + uint32_t value); + +/** + * @brief Finds the enum number of a string representation for the ScaleType enum + * + * @returns A number enum value. + */ +uint32_t scale_type_get_enum_value_number(const std::string &str); + #define SETPOINT_RAISE_OR_LOWER_MODE_ENUM_NAME_AVAILABLE 1 /** @@ -1560,6 +1594,23 @@ std::string setpoint_raise_or_lower_mode_get_enum_value_name( */ uint32_t setpoint_raise_or_lower_mode_get_enum_value_number(const std::string &str); +#define SETPOINT_TYPE_ENUM_NAME_AVAILABLE 1 + +/** + * @brief Finds the name of a field for the SetpointType enum + * + * @returns A string representation of the value. + */ +std::string setpoint_type_get_enum_value_name( + uint32_t value); + +/** + * @brief Finds the enum number of a string representation for the SetpointType enum + * + * @returns A number enum value. + */ +uint32_t setpoint_type_get_enum_value_number(const std::string &str); + #define SHADE_CONFIGURATION_MODE_ENUM_NAME_AVAILABLE 1 /** @@ -1934,6 +1985,23 @@ std::string tx_report_transmission_speed_get_enum_value_name( */ uint32_t tx_report_transmission_speed_get_enum_value_number(const std::string &str); +#define UNIFY_HUMIDITY_CONTROL_CURRENT_STATE_ENUM_NAME_AVAILABLE 1 + +/** + * @brief Finds the name of a field for the UnifyHumidityControlCurrentState enum + * + * @returns A string representation of the value. + */ +std::string unify_humidity_control_current_state_get_enum_value_name( + uint32_t value); + +/** + * @brief Finds the enum number of a string representation for the UnifyHumidityControlCurrentState enum + * + * @returns A number enum value. + */ +uint32_t unify_humidity_control_current_state_get_enum_value_number(const std::string &str); + #define WINDOW_COVERING_WINDOW_COVERING_TYPE_ENUM_NAME_AVAILABLE 1 /** diff --git a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_send_commands.h b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_send_commands.h index 64af1ec66..5df9b1c7a 100644 --- a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_send_commands.h +++ b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_send_commands.h @@ -7127,6 +7127,84 @@ void uic_mqtt_dotdot_protocol_controller_network_management_publish_write_comman void uic_mqtt_dotdot_protocol_controller_network_management_publish_write_command_to_group( uint16_t destination_group_id ); +/** + * @brief Sends/Publishes a ModeSet command for + * the UnifyHumidityControl cluster to a destination. + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/Commands/ModeSet + * + * @param destination_unid The UNID of the node that should receive the command. + * + * @param destination_endpoint The Endpoint ID of the node that should receive the command. + * + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_mode_set_command( + const dotdot_unid_t destination_unid, + const dotdot_endpoint_id_t destination_endpoint, + const uic_mqtt_dotdot_unify_humidity_control_command_mode_set_fields_t *fields + +); + +/** + * @brief Sends/Publishes a ModeSet command for + * the UnifyHumidityControl cluster to a group. + * + * Publication will be made at the following topic + * ucl/by-group/GroupID/UnifyHumidityControl/Commands/ModeSet + * + * @param destination_group_id The GroupID that should receive the command. + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_mode_set_command_to_group( + uint16_t destination_group_id, + const uic_mqtt_dotdot_unify_humidity_control_command_mode_set_fields_t *fields + +); +/** + * @brief Sends/Publishes a SetpointSet command for + * the UnifyHumidityControl cluster to a destination. + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/Commands/SetpointSet + * + * @param destination_unid The UNID of the node that should receive the command. + * + * @param destination_endpoint The Endpoint ID of the node that should receive the command. + * + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_setpoint_set_command( + const dotdot_unid_t destination_unid, + const dotdot_endpoint_id_t destination_endpoint, + const uic_mqtt_dotdot_unify_humidity_control_command_setpoint_set_fields_t *fields + +); + +/** + * @brief Sends/Publishes a SetpointSet command for + * the UnifyHumidityControl cluster to a group. + * + * Publication will be made at the following topic + * ucl/by-group/GroupID/UnifyHumidityControl/Commands/SetpointSet + * + * @param destination_group_id The GroupID that should receive the command. + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_setpoint_set_command_to_group( + uint16_t destination_group_id, + const uic_mqtt_dotdot_unify_humidity_control_command_setpoint_set_fields_t *fields + +); #ifdef __cplusplus diff --git a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_supported_generated_commands.h b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_supported_generated_commands.h index 3180bd049..24665f391 100644 --- a/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_supported_generated_commands.h +++ b/components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_supported_generated_commands.h @@ -1664,6 +1664,36 @@ void uic_mqtt_dotdot_descriptor_publish_supported_generated_commands( ); +/** + * @brief Struct containing the list of commands for UnifyHumidityControl + */ +typedef struct _uic_mqtt_dotdot_unify_humidity_control_supported_commands_ { + bool mode_set; + bool setpoint_set; + bool write_attributes; +} uic_mqtt_dotdot_unify_humidity_control_supported_commands_t; + +/** + * @brief Sends/Publishes a the SupportedGenerated commands for + * the UnifyHumidityControl cluster for a UNID/Endpoint + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/SupportedGeneratedCommands + * + * @param unid The UNID of the node on behalf of which the advertisment is made + * + * @param endpoint The Endpoint ID of the node on behalf of which the advertisment is made + * + * @param command_list Struct pointer with the fields value indicating if + * individual commands can be generated. + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_supported_generated_commands( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint, + const uic_mqtt_dotdot_unify_humidity_control_supported_commands_t *command_list +); + + #ifdef __cplusplus } diff --git a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt.cpp b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt.cpp index 5dbf0c607..bd19353ab 100644 --- a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt.cpp +++ b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt.cpp @@ -94739,6 +94739,1929 @@ sl_status_t uic_mqtt_dotdot_descriptor_init() return SL_STATUS_OK; } +// Callbacks pointers +static std::set uic_mqtt_dotdot_unify_humidity_control_mode_set_callback; +static std::set uic_mqtt_dotdot_unify_humidity_control_generated_mode_set_callback; +static std::set uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback; +static std::set uic_mqtt_dotdot_unify_humidity_control_generated_setpoint_set_callback; +static std::set uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback; +static std::set uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback; + +// Callbacks setters +void uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_set(const uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_t callback) +{ + if (callback != nullptr) { + uic_mqtt_dotdot_unify_humidity_control_mode_set_callback.insert(callback); + } +} +void uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_unset(const uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_mode_set_callback.erase(callback); +} +void uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_clear() +{ + uic_mqtt_dotdot_unify_humidity_control_mode_set_callback.clear(); +} +std::set& get_uic_mqtt_dotdot_unify_humidity_control_mode_set_callback() +{ + return uic_mqtt_dotdot_unify_humidity_control_mode_set_callback; +} + +void uic_mqtt_dotdot_unify_humidity_control_generated_mode_set_callback_set(const uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_t callback) +{ + if (callback != nullptr) { + uic_mqtt_dotdot_unify_humidity_control_generated_mode_set_callback.insert(callback); + } +} +void uic_mqtt_dotdot_unify_humidity_control_generated_mode_set_callback_unset(const uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_generated_mode_set_callback.erase(callback); +} +void uic_mqtt_dotdot_unify_humidity_control_generated_mode_set_callback_clear() +{ + uic_mqtt_dotdot_unify_humidity_control_generated_mode_set_callback.clear(); +} +void uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_set(const uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_t callback) +{ + if (callback != nullptr) { + uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback.insert(callback); + } +} +void uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_unset(const uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback.erase(callback); +} +void uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_clear() +{ + uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback.clear(); +} +std::set& get_uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback() +{ + return uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback; +} + +void uic_mqtt_dotdot_unify_humidity_control_generated_setpoint_set_callback_set(const uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_t callback) +{ + if (callback != nullptr) { + uic_mqtt_dotdot_unify_humidity_control_generated_setpoint_set_callback.insert(callback); + } +} +void uic_mqtt_dotdot_unify_humidity_control_generated_setpoint_set_callback_unset(const uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_generated_setpoint_set_callback.erase(callback); +} +void uic_mqtt_dotdot_unify_humidity_control_generated_setpoint_set_callback_clear() +{ + uic_mqtt_dotdot_unify_humidity_control_generated_setpoint_set_callback.clear(); +} + +void uic_mqtt_dotdot_set_unify_humidity_control_write_attributes_callback( + const uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback_t callback) +{ + if (callback != nullptr) { + uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback.insert(callback); + } +} +void uic_mqtt_dotdot_unset_unify_humidity_control_write_attributes_callback( + const uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback.erase(callback); +} +void uic_mqtt_dotdot_clear_unify_humidity_control_write_attributes_callbacks() +{ + uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback.clear(); +} +std::set& get_uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback() +{ + return uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback; +} + +void uic_mqtt_dotdot_set_unify_humidity_control_force_read_attributes_callback( + const uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback_t callback) +{ + if (callback != nullptr) { + uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback.insert(callback); + } +} +void uic_mqtt_dotdot_unset_unify_humidity_control_force_read_attributes_callback( + const uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback.erase(callback); +} +void uic_mqtt_dotdot_clear_unify_humidity_control_force_read_attributes_callbacks() +{ + uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback.clear(); +} + + +// Callback function for incoming publications on ucl/by-unid/+/+/UnifyHumidityControl/Commands/ModeSet +void uic_mqtt_dotdot_on_unify_humidity_control_mode_set( + const char *topic, + const char *message, + const size_t message_length) +{ + if (message_length == 0 || (uic_mqtt_dotdot_unify_humidity_control_mode_set_callback.empty())) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + ModeType mode = {}; + + + nlohmann::json jsn; + try { + jsn = nlohmann::json::parse(std::string(message)); + + + uic_mqtt_dotdot_parse_unify_humidity_control_mode_set( + jsn, + mode + ); + + } catch (const nlohmann::json::parse_error& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_PARSE_FAIL, "UnifyHumidityControl", "ModeSet"); + return; + } catch (const nlohmann::json::exception& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "ModeSet", e.what()); + return; + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "ModeSet", ""); + return; + } + + + + for (const auto& callback: uic_mqtt_dotdot_unify_humidity_control_mode_set_callback){ + callback( + static_cast(unid.c_str()), + endpoint, + UIC_MQTT_DOTDOT_CALLBACK_TYPE_NORMAL, + mode + + ); + } + +} + +// Callback function for incoming publications on ucl/by-unid/+/+/UnifyHumidityControl/GeneratedCommands/ModeSet +static void uic_mqtt_dotdot_on_generated_unify_humidity_control_mode_set( + const char *topic, + const char *message, + const size_t message_length) +{ + if (message_length == 0 || (uic_mqtt_dotdot_unify_humidity_control_generated_mode_set_callback.empty())) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + ModeType mode = {}; + + + nlohmann::json jsn; + try { + jsn = nlohmann::json::parse(std::string(message)); + + + uic_mqtt_dotdot_parse_unify_humidity_control_mode_set( + jsn, + mode + ); + + } catch (const nlohmann::json::parse_error& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_PARSE_FAIL, "UnifyHumidityControl", "ModeSet"); + return; + } catch (const nlohmann::json::exception& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "ModeSet", e.what()); + return; + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "ModeSet", ""); + return; + } + + + + + for (const auto& callback: uic_mqtt_dotdot_unify_humidity_control_generated_mode_set_callback){ + callback( + static_cast(unid.c_str()), + endpoint, + UIC_MQTT_DOTDOT_CALLBACK_TYPE_NORMAL, + mode + + ); + } +} + + +// Callback function for incoming publications on ucl/by-unid/+/+/UnifyHumidityControl/Commands/SetpointSet +void uic_mqtt_dotdot_on_unify_humidity_control_setpoint_set( + const char *topic, + const char *message, + const size_t message_length) +{ + if (message_length == 0 || (uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback.empty())) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + SetpointType type = {}; + uint8_t precision = {}; + uint8_t scale = {}; + int32_t value = {}; + + + nlohmann::json jsn; + try { + jsn = nlohmann::json::parse(std::string(message)); + + + uic_mqtt_dotdot_parse_unify_humidity_control_setpoint_set( + jsn, + type, + + precision, + + scale, + + value + ); + + } catch (const nlohmann::json::parse_error& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_PARSE_FAIL, "UnifyHumidityControl", "SetpointSet"); + return; + } catch (const nlohmann::json::exception& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "SetpointSet", e.what()); + return; + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "SetpointSet", ""); + return; + } + + + + for (const auto& callback: uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback){ + callback( + static_cast(unid.c_str()), + endpoint, + UIC_MQTT_DOTDOT_CALLBACK_TYPE_NORMAL, + type, + + precision, + + scale, + + value + + ); + } + +} + +// Callback function for incoming publications on ucl/by-unid/+/+/UnifyHumidityControl/GeneratedCommands/SetpointSet +static void uic_mqtt_dotdot_on_generated_unify_humidity_control_setpoint_set( + const char *topic, + const char *message, + const size_t message_length) +{ + if (message_length == 0 || (uic_mqtt_dotdot_unify_humidity_control_generated_setpoint_set_callback.empty())) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + SetpointType type = {}; + uint8_t precision = {}; + uint8_t scale = {}; + int32_t value = {}; + + + nlohmann::json jsn; + try { + jsn = nlohmann::json::parse(std::string(message)); + + + uic_mqtt_dotdot_parse_unify_humidity_control_setpoint_set( + jsn, + type, + + precision, + + scale, + + value + ); + + } catch (const nlohmann::json::parse_error& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_PARSE_FAIL, "UnifyHumidityControl", "SetpointSet"); + return; + } catch (const nlohmann::json::exception& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "SetpointSet", e.what()); + return; + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "SetpointSet", ""); + return; + } + + + + + for (const auto& callback: uic_mqtt_dotdot_unify_humidity_control_generated_setpoint_set_callback){ + callback( + static_cast(unid.c_str()), + endpoint, + UIC_MQTT_DOTDOT_CALLBACK_TYPE_NORMAL, + type, + + precision, + + scale, + + value + + ); + } +} + + +// Callback function for incoming publications on ucl/by-unid/+/+/UnifyHumidityControl/Commands/WriteAttributes +void uic_mqtt_dotdot_on_unify_humidity_control_WriteAttributes( + const char *topic, + const char *message, + const size_t message_length) +{ + if (uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback.empty()) { + return; + } + + if (message_length == 0) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_state_t new_state = {}; + uic_mqtt_dotdot_unify_humidity_control_updated_state_t new_updated_state = {}; + + + nlohmann::json jsn; + try { + jsn = nlohmann::json::parse(std::string(message)); + + uic_mqtt_dotdot_parse_unify_humidity_control_write_attributes( + jsn, + new_state, + new_updated_state + ); + } catch (const nlohmann::json::parse_error& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_PARSE_FAIL, "UnifyHumidityControl", "WriteAttributes"); + return; + } catch (const nlohmann::json::exception& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "WriteAttributes", e.what()); + return; + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "WriteAttributes", ""); + return; + } + + for (const auto& callback: uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback){ + callback( + static_cast(unid.c_str()), + endpoint, + UIC_MQTT_DOTDOT_CALLBACK_TYPE_NORMAL, + new_state, + new_updated_state + ); + } + +} + +static void uic_mqtt_dotdot_on_unify_humidity_control_force_read_attributes( + const char *topic, + const char *message, + const size_t message_length) +{ + uint8_t endpoint = 0; + std::string unid; + + if ((message_length == 0) || (uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback.empty())) { + return; + } + + if(! uic_dotdot_mqtt::parse_topic(topic, unid, endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + try { + uic_mqtt_dotdot_unify_humidity_control_updated_state_t force_update = {0}; + bool trigger_handler = false; + + nlohmann::json jsn = nlohmann::json::parse(std::string(message)); + std::vector attributes = jsn["value"].get>(); + + // Assume all attributes to be read on empty array received + if (attributes.size() == 0) { + force_update.reporting_mode = true; + force_update.supported_reporting_mode = true; + force_update.current_state = true; + force_update.supported_set_points = true; + force_update.humidifier_setpoint_min = true; + force_update.humidifier_setpoint_max = true; + force_update.humidifier_setpoint = true; + force_update.humidifier_setpoint_scale = true; + force_update.humidifier_setpoint_precision = true; + force_update.dehumidifier_setpoint_min = true; + force_update.dehumidifier_setpoint_max = true; + force_update.dehumidifier_setpoint = true; + force_update.dehumidifier_setpoint_scale = true; + force_update.dehumidifier_setpoint_precision = true; + force_update.auto_setpoint_min = true; + force_update.auto_setpoint_max = true; + force_update.auto_setpoint = true; + force_update.auto_setpoint_scale = true; + force_update.auto_setpoint_precision = true; + trigger_handler = true; + } else { + std::unordered_map supported_attrs = { + {"ReportingMode", &force_update.reporting_mode }, + {"SupportedReportingMode", &force_update.supported_reporting_mode }, + {"CurrentState", &force_update.current_state }, + {"SupportedSetPoints", &force_update.supported_set_points }, + {"HumidifierSetpointMin", &force_update.humidifier_setpoint_min }, + {"HumidifierSetpointMax", &force_update.humidifier_setpoint_max }, + {"HumidifierSetpoint", &force_update.humidifier_setpoint }, + {"HumidifierSetpointScale", &force_update.humidifier_setpoint_scale }, + {"HumidifierSetpointPrecision", &force_update.humidifier_setpoint_precision }, + {"DehumidifierSetpointMin", &force_update.dehumidifier_setpoint_min }, + {"DehumidifierSetpointMax", &force_update.dehumidifier_setpoint_max }, + {"DehumidifierSetpoint", &force_update.dehumidifier_setpoint }, + {"DehumidifierSetpointScale", &force_update.dehumidifier_setpoint_scale }, + {"DehumidifierSetpointPrecision", &force_update.dehumidifier_setpoint_precision }, + {"AutoSetpointMin", &force_update.auto_setpoint_min }, + {"AutoSetpointMax", &force_update.auto_setpoint_max }, + {"AutoSetpoint", &force_update.auto_setpoint }, + {"AutoSetpointScale", &force_update.auto_setpoint_scale }, + {"AutoSetpointPrecision", &force_update.auto_setpoint_precision }, + }; + + for (auto& attribute : attributes) { + auto found_attr = supported_attrs.find(attribute); + if (found_attr != supported_attrs.end()) { + *(found_attr->second) = true; + trigger_handler = true; + } + } + } + + if (trigger_handler == true) { + for (const auto& callback: uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback) { + callback( + static_cast(unid.c_str()), + endpoint, + UIC_MQTT_DOTDOT_CALLBACK_TYPE_NORMAL, + force_update + ); + } + } + } catch (...) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl/Commands/ForceReadAttributes: Unable to parse JSON payload"); + return; + } +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_reporting_mode_publish( + const char *base_topic, + ModeType value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + #ifdef UNIFY_HUMIDITY_CONTROL_REPORTING_MODE_ENUM_NAME_AVAILABLE + jsn["value"] = unify_humidity_control_reporting_mode_get_enum_value_name((uint32_t)value); + #elif defined(MODE_TYPE_ENUM_NAME_AVAILABLE) + jsn["value"] = mode_type_get_enum_value_name((uint32_t)value); + #else + sl_log_warning(LOG_TAG,"Warning: Enum name not available for UNIFY_HUMIDITY_CONTROL_REPORTING_MODE. Using number instead."); + jsn["value"] = static_cast(value); + #endif + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/ReportingMode", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/ReportingMode"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_reporting_mode_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/ReportingMode"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_supported_reporting_mode_publish( + const char *base_topic, + uint8_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + nlohmann::json bitmap_values = UnifyHumidityControlSupportedReportingMode.get_bitmap_values_as_json_tree((uint32_t)value); + jsn["value"] = bitmap_values; + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/SupportedReportingMode", e.what()); + return SL_STATUS_OK; + } + + boost::replace_all(payload_str, "\"true\"", "true"); + boost::replace_all(payload_str, "\"false\"", "false"); + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/SupportedReportingMode"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_supported_reporting_mode_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/SupportedReportingMode"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_current_state_publish( + const char *base_topic, + uint8_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + #ifdef UNIFY_HUMIDITY_CONTROL_CURRENT_STATE_ENUM_NAME_AVAILABLE + jsn["value"] = unify_humidity_control_current_state_get_enum_value_name((uint32_t)value); + #elif defined(ENUM8_ENUM_NAME_AVAILABLE) + jsn["value"] = enum8_get_enum_value_name((uint32_t)value); + #else + sl_log_warning(LOG_TAG,"Warning: Enum name not available for UNIFY_HUMIDITY_CONTROL_CURRENT_STATE. Using number instead."); + jsn["value"] = static_cast(value); + #endif + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/CurrentState", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/CurrentState"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_current_state_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/CurrentState"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_supported_set_points_publish( + const char *base_topic, + uint8_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + nlohmann::json bitmap_values = UnifyHumidityControlSupportedSetPoints.get_bitmap_values_as_json_tree((uint32_t)value); + jsn["value"] = bitmap_values; + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/SupportedSetPoints", e.what()); + return SL_STATUS_OK; + } + + boost::replace_all(payload_str, "\"true\"", "true"); + boost::replace_all(payload_str, "\"false\"", "false"); + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/SupportedSetPoints"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_supported_set_points_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/SupportedSetPoints"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_min_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + if (true == uic_dotdot_has_attribute_value_a_name(64928,5,value)) { + jsn["value"] = uic_dotdot_get_attribute_value_name(64928,5,value); + }else{ + jsn["value"] = value; + } + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/HumidifierSetpointMin", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/HumidifierSetpointMin"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_min_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/HumidifierSetpointMin"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_max_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + if (true == uic_dotdot_has_attribute_value_a_name(64928,6,value)) { + jsn["value"] = uic_dotdot_get_attribute_value_name(64928,6,value); + }else{ + jsn["value"] = value; + } + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/HumidifierSetpointMax", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/HumidifierSetpointMax"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_max_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/HumidifierSetpointMax"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + if (true == uic_dotdot_has_attribute_value_a_name(64928,7,value)) { + jsn["value"] = uic_dotdot_get_attribute_value_name(64928,7,value); + }else{ + jsn["value"] = value; + } + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/HumidifierSetpoint", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/HumidifierSetpoint"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/HumidifierSetpoint"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_scale_publish( + const char *base_topic, + ScaleType value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + #ifdef UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE_ENUM_NAME_AVAILABLE + jsn["value"] = unify_humidity_control_humidifier_setpoint_scale_get_enum_value_name((uint32_t)value); + #elif defined(SCALE_TYPE_ENUM_NAME_AVAILABLE) + jsn["value"] = scale_type_get_enum_value_name((uint32_t)value); + #else + sl_log_warning(LOG_TAG,"Warning: Enum name not available for UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE. Using number instead."); + jsn["value"] = static_cast(value); + #endif + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/HumidifierSetpointScale", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/HumidifierSetpointScale"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_scale_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/HumidifierSetpointScale"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_precision_publish( + const char *base_topic, + uint8_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + if (true == uic_dotdot_has_attribute_value_a_name(64928,9,value)) { + jsn["value"] = uic_dotdot_get_attribute_value_name(64928,9,value); + }else{ + jsn["value"] = value; + } + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/HumidifierSetpointPrecision", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/HumidifierSetpointPrecision"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_precision_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/HumidifierSetpointPrecision"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_min_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + if (true == uic_dotdot_has_attribute_value_a_name(64928,10,value)) { + jsn["value"] = uic_dotdot_get_attribute_value_name(64928,10,value); + }else{ + jsn["value"] = value; + } + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/DehumidifierSetpointMin", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/DehumidifierSetpointMin"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_min_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/DehumidifierSetpointMin"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_max_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + if (true == uic_dotdot_has_attribute_value_a_name(64928,11,value)) { + jsn["value"] = uic_dotdot_get_attribute_value_name(64928,11,value); + }else{ + jsn["value"] = value; + } + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/DehumidifierSetpointMax", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/DehumidifierSetpointMax"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_max_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/DehumidifierSetpointMax"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + if (true == uic_dotdot_has_attribute_value_a_name(64928,12,value)) { + jsn["value"] = uic_dotdot_get_attribute_value_name(64928,12,value); + }else{ + jsn["value"] = value; + } + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/DehumidifierSetpoint", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/DehumidifierSetpoint"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/DehumidifierSetpoint"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_scale_publish( + const char *base_topic, + ScaleType value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + #ifdef UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE_ENUM_NAME_AVAILABLE + jsn["value"] = unify_humidity_control_dehumidifier_setpoint_scale_get_enum_value_name((uint32_t)value); + #elif defined(SCALE_TYPE_ENUM_NAME_AVAILABLE) + jsn["value"] = scale_type_get_enum_value_name((uint32_t)value); + #else + sl_log_warning(LOG_TAG,"Warning: Enum name not available for UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE. Using number instead."); + jsn["value"] = static_cast(value); + #endif + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/DehumidifierSetpointScale", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/DehumidifierSetpointScale"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_scale_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/DehumidifierSetpointScale"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_precision_publish( + const char *base_topic, + uint8_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + if (true == uic_dotdot_has_attribute_value_a_name(64928,14,value)) { + jsn["value"] = uic_dotdot_get_attribute_value_name(64928,14,value); + }else{ + jsn["value"] = value; + } + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/DehumidifierSetpointPrecision", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/DehumidifierSetpointPrecision"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_precision_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/DehumidifierSetpointPrecision"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_min_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + if (true == uic_dotdot_has_attribute_value_a_name(64928,15,value)) { + jsn["value"] = uic_dotdot_get_attribute_value_name(64928,15,value); + }else{ + jsn["value"] = value; + } + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/AutoSetpointMin", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/AutoSetpointMin"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_min_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/AutoSetpointMin"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_max_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + if (true == uic_dotdot_has_attribute_value_a_name(64928,16,value)) { + jsn["value"] = uic_dotdot_get_attribute_value_name(64928,16,value); + }else{ + jsn["value"] = value; + } + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/AutoSetpointMax", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/AutoSetpointMax"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_max_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/AutoSetpointMax"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_publish( + const char *base_topic, + int32_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + if (true == uic_dotdot_has_attribute_value_a_name(64928,17,value)) { + jsn["value"] = uic_dotdot_get_attribute_value_name(64928,17,value); + }else{ + jsn["value"] = value; + } + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/AutoSetpoint", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/AutoSetpoint"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/AutoSetpoint"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_scale_publish( + const char *base_topic, + ScaleType value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + #ifdef UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE_ENUM_NAME_AVAILABLE + jsn["value"] = unify_humidity_control_auto_setpoint_scale_get_enum_value_name((uint32_t)value); + #elif defined(SCALE_TYPE_ENUM_NAME_AVAILABLE) + jsn["value"] = scale_type_get_enum_value_name((uint32_t)value); + #else + sl_log_warning(LOG_TAG,"Warning: Enum name not available for UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE. Using number instead."); + jsn["value"] = static_cast(value); + #endif + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/AutoSetpointScale", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/AutoSetpointScale"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_scale_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/AutoSetpointScale"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_precision_publish( + const char *base_topic, + uint8_t value, + uic_mqtt_dotdot_attribute_publish_type_t publish_type +) +{ + nlohmann::json jsn; + + // This is a single value + + if (true == uic_dotdot_has_attribute_value_a_name(64928,19,value)) { + jsn["value"] = uic_dotdot_get_attribute_value_name(64928,19,value); + }else{ + jsn["value"] = value; + } + + + std::string payload_str; + try { + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + payload_str = jsn.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + } catch (const nlohmann::json::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl/Attributes/AutoSetpointPrecision", e.what()); + return SL_STATUS_OK; + } + + + std::string topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/AutoSetpointPrecision"; + if (publish_type & UCL_MQTT_PUBLISH_TYPE_DESIRED) + { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + if (publish_type & UCL_MQTT_PUBLISH_TYPE_REPORTED) + { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } + return SL_STATUS_OK; +} + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_precision_unretain( + const char *base_topic, + uic_mqtt_dotdot_attribute_publish_type_t publish_type) +{ + // clang-format on + std::string topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/AutoSetpointPrecision"; + + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_DESIRED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_desired = topic + "/Desired"; + uic_mqtt_publish(topic_desired.c_str(), NULL, 0, true); + } + if ((publish_type == UCL_MQTT_PUBLISH_TYPE_REPORTED) + || (publish_type == UCL_MQTT_PUBLISH_TYPE_ALL)) { + std::string topic_reported = topic + "/Reported"; + uic_mqtt_publish(topic_reported.c_str(), NULL, 0, true); + } + return SL_STATUS_OK; +} +// clang-format off + + +sl_status_t uic_mqtt_dotdot_unify_humidity_control_init() +{ + std::string base_topic = "ucl/by-unid/+/+/"; + + std::string subscription_topic; + if(!uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback.empty()) { + subscription_topic = base_topic + "UnifyHumidityControl/Commands/WriteAttributes"; + uic_mqtt_subscribe(subscription_topic.c_str(), uic_mqtt_dotdot_on_unify_humidity_control_WriteAttributes); + } + + if(!uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback.empty()) { + subscription_topic = base_topic + "UnifyHumidityControl/Commands/ForceReadAttributes"; + uic_mqtt_subscribe(subscription_topic.c_str(), uic_mqtt_dotdot_on_unify_humidity_control_force_read_attributes); + } + if (!uic_mqtt_dotdot_unify_humidity_control_mode_set_callback.empty()) { + subscription_topic = base_topic + "UnifyHumidityControl/Commands/ModeSet"; + uic_mqtt_subscribe(subscription_topic.c_str(), uic_mqtt_dotdot_on_unify_humidity_control_mode_set); + } + if (!uic_mqtt_dotdot_unify_humidity_control_generated_mode_set_callback.empty()) { + subscription_topic = base_topic + "UnifyHumidityControl/GeneratedCommands/ModeSet"; + uic_mqtt_subscribe(subscription_topic.c_str(), uic_mqtt_dotdot_on_generated_unify_humidity_control_mode_set); + } + if (!uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback.empty()) { + subscription_topic = base_topic + "UnifyHumidityControl/Commands/SetpointSet"; + uic_mqtt_subscribe(subscription_topic.c_str(), uic_mqtt_dotdot_on_unify_humidity_control_setpoint_set); + } + if (!uic_mqtt_dotdot_unify_humidity_control_generated_setpoint_set_callback.empty()) { + subscription_topic = base_topic + "UnifyHumidityControl/GeneratedCommands/SetpointSet"; + uic_mqtt_subscribe(subscription_topic.c_str(), uic_mqtt_dotdot_on_generated_unify_humidity_control_setpoint_set); + } + + // Init the attributes for that cluster + uic_mqtt_dotdot_unify_humidity_control_attributes_init(); + + uic_mqtt_dotdot_by_group_unify_humidity_control_init(); + + return SL_STATUS_OK; +} + sl_status_t uic_mqtt_dotdot_init() { @@ -94952,6 +96875,10 @@ sl_status_t uic_mqtt_dotdot_init() { status_flag = uic_mqtt_dotdot_descriptor_init(); } + if (status_flag == SL_STATUS_OK) { + status_flag = uic_mqtt_dotdot_unify_humidity_control_init(); + } + return status_flag; } @@ -95013,6 +96940,7 @@ void uic_mqtt_dotdot_publish_supported_commands( uic_mqtt_dotdot_aox_position_estimation_publish_supported_commands(unid, endpoint_id); uic_mqtt_dotdot_protocol_controller_network_management_publish_supported_commands(unid, 0); uic_mqtt_dotdot_descriptor_publish_supported_commands(unid, endpoint_id); + uic_mqtt_dotdot_unify_humidity_control_publish_supported_commands(unid, endpoint_id); } void uic_mqtt_dotdot_publish_empty_supported_commands( @@ -95071,6 +96999,7 @@ void uic_mqtt_dotdot_publish_empty_supported_commands( uic_mqtt_dotdot_aox_position_estimation_publish_empty_supported_commands(unid, endpoint_id); uic_mqtt_dotdot_protocol_controller_network_management_publish_empty_supported_commands(unid); uic_mqtt_dotdot_descriptor_publish_empty_supported_commands(unid, endpoint_id); + uic_mqtt_dotdot_unify_humidity_control_publish_empty_supported_commands(unid, endpoint_id); } // Publishing Cluster Revision for Basic Cluster @@ -108533,6 +110462,216 @@ void uic_mqtt_dotdot_descriptor_publish_empty_supported_commands( } } +// Publishing Cluster Revision for UnifyHumidityControl Cluster +void uic_mqtt_dotdot_unify_humidity_control_publish_cluster_revision(const char* base_topic, uint16_t value) +{ + std::string cluster_topic = std::string(base_topic) + "/UnifyHumidityControl/Attributes/ClusterRevision"; + // Publish Desired + std::string pub_topic_des = cluster_topic + "/Desired"; + std::string payload = std::string(R"({"value": )") + + std::to_string(value) + std::string("}"); + uic_mqtt_publish(pub_topic_des.c_str(), + payload.c_str(), + payload.size(), + true); + // Publish Reported + std::string pub_topic_rep = cluster_topic + "/Reported"; + uic_mqtt_publish(pub_topic_rep.c_str(), + payload.c_str(), + payload.size(), + true); +} + +// Unretain Cluster Revision for UnifyHumidityControl Cluster +void uic_mqtt_dotdot_unify_humidity_control_unretain_cluster_revision(const char* base_topic) +{ + // clang-format on + std::string cluster_topic + = std::string(base_topic) + + "/UnifyHumidityControl/Attributes/ClusterRevision"; + // Publish Desired + std::string desired_topic = cluster_topic + "/Desired"; + uic_mqtt_publish(desired_topic.c_str(), NULL, 0, true); + // Publish Reported + std::string reported_topic = cluster_topic + "/Reported"; + uic_mqtt_publish(reported_topic.c_str(), NULL, 0, true); + // clang-format off +} + +static inline bool uic_mqtt_dotdot_unify_humidity_control_mode_set_is_supported( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id) +{ + ModeType mode_value; + memset(&mode_value, 0x00, sizeof(mode_value)); + for (const auto& callback: uic_mqtt_dotdot_unify_humidity_control_mode_set_callback) { + if (callback( unid, endpoint_id, UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK + , + mode_value + + ) == SL_STATUS_OK) { + return true; + } + } + + return false; +} +static inline bool uic_mqtt_dotdot_unify_humidity_control_setpoint_set_is_supported( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id) +{ + SetpointType type_value; + memset(&type_value, 0x00, sizeof(type_value)); + uint8_t precision_value; + memset(&precision_value, 0x00, sizeof(precision_value)); + uint8_t scale_value; + memset(&scale_value, 0x00, sizeof(scale_value)); + int32_t value_value; + memset(&value_value, 0x00, sizeof(value_value)); + for (const auto& callback: uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback) { + if (callback( unid, endpoint_id, UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK + , + type_value, + + precision_value, + + scale_value, + + value_value + + ) == SL_STATUS_OK) { + return true; + } + } + + return false; +} + +static inline bool uic_mqtt_dotdot_unify_humidity_control_write_attributes_is_supported( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id) +{ + for (const auto& callback: uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback) { + uic_mqtt_dotdot_unify_humidity_control_state_t unify_humidity_control_new_state = {}; + uic_mqtt_dotdot_unify_humidity_control_updated_state_t unify_humidity_control_new_updated_state = {}; + + if (callback( + unid, + endpoint_id, + UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK, + unify_humidity_control_new_state, + unify_humidity_control_new_updated_state + ) == SL_STATUS_OK) { + return true; + } + } + return false; +} + +static inline bool uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_is_supported( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id) +{ + for (const auto& callback: uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback) { + uic_mqtt_dotdot_unify_humidity_control_updated_state_t unify_humidity_control_force_update = {0}; + if (callback( + unid, + endpoint_id, + UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK, + unify_humidity_control_force_update + ) == SL_STATUS_OK) { + return true; + } + } + return false; +} + +// Publishing Supported Commands for UnifyHumidityControl Cluster +void uic_mqtt_dotdot_unify_humidity_control_publish_supported_commands( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id) +{ + std::stringstream ss; + bool first_command = true; + ss.str(""); + + // check if there is callback for each command + if (uic_mqtt_dotdot_unify_humidity_control_mode_set_is_supported(unid, endpoint_id)) { + if (first_command == false) { + ss << ", "; + } + first_command = false; + ss << R"("ModeSet")"; + } + if (uic_mqtt_dotdot_unify_humidity_control_setpoint_set_is_supported(unid, endpoint_id)) { + if (first_command == false) { + ss << ", "; + } + first_command = false; + ss << R"("SetpointSet")"; + } + + // Check for a WriteAttributes Callback + if(uic_mqtt_dotdot_unify_humidity_control_write_attributes_is_supported(unid, endpoint_id)) { + if (first_command == false) { + ss << ", "; + } + first_command = false; + ss << R"("WriteAttributes")"; + } + + // Check for a ForceReadAttributes Callback + if (uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_is_supported(unid, endpoint_id)) { + if (first_command == false) { + ss << ", "; + } + first_command = false; + ss << R"("ForceReadAttributes")"; + } + + // Publish supported commands + std::string topic = "ucl/by-unid/" + std::string(unid); + topic += "/ep"+ std::to_string(endpoint_id); + topic += "/UnifyHumidityControl/SupportedCommands"; + std::string payload_str("{\"value\": [" + ss.str() + "]" + "}"); + if (first_command == false) { + uic_mqtt_publish(topic.c_str(), + payload_str.c_str(), + payload_str.length(), + true); + } else if (uic_mqtt_count_topics(topic.c_str()) == 0) { + // There are no supported commands, but make sure we publish some + // SupportedCommands = [] if any attribute has been published for a cluster. + std::string attributes_topic = "ucl/by-unid/" + std::string(unid); + attributes_topic += "/ep"+ std::to_string(endpoint_id); + attributes_topic += "/UnifyHumidityControl/Attributes"; + + if (uic_mqtt_count_topics(attributes_topic.c_str()) > 0) { + uic_mqtt_publish(topic.c_str(), + EMPTY_VALUE_ARRAY, + strlen(EMPTY_VALUE_ARRAY), + true); + } + } +} + +// Publishing empty/no Supported Commands for UnifyHumidityControl Cluster +void uic_mqtt_dotdot_unify_humidity_control_publish_empty_supported_commands( + const dotdot_unid_t unid + , dotdot_endpoint_id_t endpoint_id) +{ + std::string topic = "ucl/by-unid/" + std::string(unid); + topic += "/ep"+ std::to_string(endpoint_id); + topic += "/UnifyHumidityControl/SupportedCommands"; + + if (uic_mqtt_count_topics(topic.c_str()) > 0) { + uic_mqtt_publish(topic.c_str(), + EMPTY_VALUE_ARRAY, + strlen(EMPTY_VALUE_ARRAY), + true); + } +} + //////////////////////////////////////////////////////////////////////////////// // Generated Commands publications functions @@ -115181,3 +117320,75 @@ void uic_mqtt_dotdot_protocol_controller_network_management_publish_generated_wr payload.size(), false); } +/** + * @brief Publishes an incoming/generated ModeSet command for + * the UnifyHumidityControl cluster. + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/GeneratedCommands/ModeSet + * + * @param unid The UNID of the node that sent us the command. + * + * @param endpoint The Endpoint ID of the node that sent us the command. + * + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_generated_mode_set_command( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint, + const uic_mqtt_dotdot_unify_humidity_control_command_mode_set_fields_t *fields + +) { + // Create the topic + std::string topic = "ucl/by-unid/"+ std::string(unid) + "/ep" + + std::to_string(endpoint) + "/"; + topic += "UnifyHumidityControl/GeneratedCommands/ModeSet"; + + std::string payload = + get_json_payload_for_unify_humidity_control_mode_set_command( + fields); + + // Publish our command + uic_mqtt_publish(topic.c_str(), + payload.c_str(), + payload.size(), + false); +} +/** + * @brief Publishes an incoming/generated SetpointSet command for + * the UnifyHumidityControl cluster. + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/GeneratedCommands/SetpointSet + * + * @param unid The UNID of the node that sent us the command. + * + * @param endpoint The Endpoint ID of the node that sent us the command. + * + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_generated_setpoint_set_command( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint, + const uic_mqtt_dotdot_unify_humidity_control_command_setpoint_set_fields_t *fields + +) { + // Create the topic + std::string topic = "ucl/by-unid/"+ std::string(unid) + "/ep" + + std::to_string(endpoint) + "/"; + topic += "UnifyHumidityControl/GeneratedCommands/SetpointSet"; + + std::string payload = + get_json_payload_for_unify_humidity_control_setpoint_set_command( + fields); + + // Publish our command + uic_mqtt_publish(topic.c_str(), + payload.c_str(), + payload.size(), + false); +} diff --git a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt.hpp b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt.hpp index 156e7b356..1af04197b 100644 --- a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt.hpp +++ b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt.hpp @@ -367,6 +367,13 @@ sl_status_t uic_mqtt_dotdot_by_group_aox_position_estimation_init(); */ sl_status_t uic_mqtt_dotdot_by_group_descriptor_init(); +/** + * @brief Initialize UnifyHumidityControl dotdot bygroup command handlers + * + * @returns SL_STATUS_OK on success, error otherwise. + */ +sl_status_t uic_mqtt_dotdot_by_group_unify_humidity_control_init(); + // clang-format on @@ -5052,6 +5059,65 @@ void uic_mqtt_dotdot_on_descriptor_WriteAttributes( const size_t message_length); +// clang-format on + +/** + * @brief Retrieves the container with callbacks pointer for + * by-unid UnifyHumidityControl/Commands/ModeSet messages + * + * @returns std::set of callbacks. + */ +std::set &get_uic_mqtt_dotdot_unify_humidity_control_mode_set_callback(); + +/** + * @brief MQTT Subscribe handler for incoming publications on: + * ucl/by-unid/+/+/UnifyHumidityControl/Commands/ModeSet + */ +// clang-format off +void uic_mqtt_dotdot_on_unify_humidity_control_mode_set( + const char *topic, + const char *message, + const size_t message_length); +// clang-format on + +/** + * @brief Retrieves the container with callbacks pointer for + * by-unid UnifyHumidityControl/Commands/SetpointSet messages + * + * @returns std::set of callbacks. + */ +std::set &get_uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback(); + +/** + * @brief MQTT Subscribe handler for incoming publications on: + * ucl/by-unid/+/+/UnifyHumidityControl/Commands/SetpointSet + */ +// clang-format off +void uic_mqtt_dotdot_on_unify_humidity_control_setpoint_set( + const char *topic, + const char *message, + const size_t message_length); +// clang-format on + +/** + * @brief Retrieves the container with callback pointers for by-unid + * /Commands/WriteAttributes messages + * + * @returns std::set of callbacks. + */ +std::set & get_uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback(); + +/** + * @brief MQTT Subscribe handler for incoming publications on: + * ucl/by-unid/+/+/UnifyHumidityControl/Commands/WriteAttributes + */ +// clang-format off +void uic_mqtt_dotdot_on_unify_humidity_control_WriteAttributes( + const char *topic, + const char *message, + const size_t message_length); + + // All bitmaps are defined as the cluster label for the bitmap plus the command/attribute name @@ -5891,6 +5957,26 @@ const std::vector, std::vector, std::vector>>> UnifyHumidityControlSupportedReportingMode_bitmap_data { +{ {"Humidify", "bool", "0x1", "0"}, { +} }, +{ {"Dehumidify", "bool", "0x2", "1"}, { +} }, +{ {"Auto", "bool", "0x4", "2"}, { +} } +}; +const dotdot_bitmap UnifyHumidityControlSupportedReportingMode("UnifyHumidityControlSupportedReportingMode", "Unknown UnifyHumidityControlSupportedReportingMode", UnifyHumidityControlSupportedReportingMode_bitmap_data); + +const std::vector, std::vector>>> UnifyHumidityControlSupportedSetPoints_bitmap_data { +{ {"Humidifier", "bool", "0x1", "0"}, { +} }, +{ {"Dehumidifier", "bool", "0x2", "1"}, { +} }, +{ {"Auto", "bool", "0x4", "2"}, { +} } +}; +const dotdot_bitmap UnifyHumidityControlSupportedSetPoints("UnifyHumidityControlSupportedSetPoints", "Unknown UnifyHumidityControlSupportedSetPoints", UnifyHumidityControlSupportedSetPoints_bitmap_data); + const std::vector, std::vector>>> WindowCoveringConfigOrStatus_bitmap_data { { {"Operational", "bool", "0x1", "0"}, { } }, diff --git a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_attributes.cpp b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_attributes.cpp index 43090fc98..995736a59 100644 --- a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_attributes.cpp +++ b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_attributes.cpp @@ -63117,3 +63117,1685 @@ void uic_mqtt_dotdot_descriptor_attribute_device_type_list_callback_set(const ui // End of supported cluster. +/////////////////////////////////////////////////////////////////////////////// +// Callback pointers for UnifyHumidityControl +/////////////////////////////////////////////////////////////////////////////// +static uic_mqtt_dotdot_unify_humidity_control_attribute_reporting_mode_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_reporting_mode_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_supported_reporting_mode_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_supported_reporting_mode_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_current_state_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_current_state_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_supported_set_points_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_supported_set_points_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_min_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_min_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_max_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_max_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_scale_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_scale_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_precision_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_precision_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_min_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_min_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_max_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_max_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_scale_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_scale_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_precision_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_precision_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_min_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_min_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_max_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_max_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_scale_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_scale_callback = nullptr; +static uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_precision_callback_t uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_precision_callback = nullptr; + +/////////////////////////////////////////////////////////////////////////////// +// Attribute update handlers for UnifyHumidityControl +/////////////////////////////////////////////////////////////////////////////// +static void uic_mqtt_dotdot_on_unify_humidity_control_reporting_mode_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_reporting_mode_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + ModeType reporting_mode = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::ReportingMode: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + uint32_t tmp = get_enum_decimal_value("value", json_payload); + if (tmp == numeric_limits::max()) { + #ifdef UNIFY_HUMIDITY_CONTROL_REPORTING_MODE_ENUM_NAME_AVAILABLE + tmp = unify_humidity_control_reporting_mode_get_enum_value_number(json_payload.at("value").get()); + #elif defined(REPORTING_MODE_ENUM_NAME_AVAILABLE) + tmp = reporting_mode_get_enum_value_number(json_payload.at("value").get()); + #endif + } + reporting_mode = static_cast(tmp); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_reporting_mode_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + reporting_mode + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_supported_reporting_mode_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_supported_reporting_mode_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + uint8_t supported_reporting_mode = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::SupportedReportingMode: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + supported_reporting_mode = uic_dotdot_mqtt::get_bitmap_decimal_value("value", json_payload, UnifyHumidityControlSupportedReportingMode); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_supported_reporting_mode_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + supported_reporting_mode + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_current_state_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_current_state_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + uint8_t current_state = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::CurrentState: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + uint32_t tmp = get_enum_decimal_value("value", json_payload); + if (tmp == numeric_limits::max()) { + #ifdef UNIFY_HUMIDITY_CONTROL_CURRENT_STATE_ENUM_NAME_AVAILABLE + tmp = unify_humidity_control_current_state_get_enum_value_number(json_payload.at("value").get()); + #elif defined(CURRENT_STATE_ENUM_NAME_AVAILABLE) + tmp = current_state_get_enum_value_number(json_payload.at("value").get()); + #endif + } + current_state = static_cast(tmp); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_current_state_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + current_state + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_supported_set_points_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_supported_set_points_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + uint8_t supported_set_points = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::SupportedSetPoints: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + supported_set_points = uic_dotdot_mqtt::get_bitmap_decimal_value("value", json_payload, UnifyHumidityControlSupportedSetPoints); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_supported_set_points_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + supported_set_points + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_humidifier_setpoint_min_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_min_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + int32_t humidifier_setpoint_min = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::HumidifierSetpointMin: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + humidifier_setpoint_min = json_payload.at("value").get(); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_min_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + humidifier_setpoint_min + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_humidifier_setpoint_max_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_max_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + int32_t humidifier_setpoint_max = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::HumidifierSetpointMax: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + humidifier_setpoint_max = json_payload.at("value").get(); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_max_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + humidifier_setpoint_max + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_humidifier_setpoint_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + int32_t humidifier_setpoint = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::HumidifierSetpoint: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + humidifier_setpoint = json_payload.at("value").get(); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + humidifier_setpoint + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_humidifier_setpoint_scale_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_scale_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + ScaleType humidifier_setpoint_scale = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::HumidifierSetpointScale: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + uint32_t tmp = get_enum_decimal_value("value", json_payload); + if (tmp == numeric_limits::max()) { + #ifdef UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE_ENUM_NAME_AVAILABLE + tmp = unify_humidity_control_humidifier_setpoint_scale_get_enum_value_number(json_payload.at("value").get()); + #elif defined(HUMIDIFIER_SETPOINT_SCALE_ENUM_NAME_AVAILABLE) + tmp = humidifier_setpoint_scale_get_enum_value_number(json_payload.at("value").get()); + #endif + } + humidifier_setpoint_scale = static_cast(tmp); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_scale_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + humidifier_setpoint_scale + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_humidifier_setpoint_precision_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_precision_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + uint8_t humidifier_setpoint_precision = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::HumidifierSetpointPrecision: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + humidifier_setpoint_precision = json_payload.at("value").get(); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_precision_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + humidifier_setpoint_precision + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_dehumidifier_setpoint_min_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_min_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + int32_t dehumidifier_setpoint_min = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::DehumidifierSetpointMin: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + dehumidifier_setpoint_min = json_payload.at("value").get(); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_min_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + dehumidifier_setpoint_min + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_dehumidifier_setpoint_max_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_max_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + int32_t dehumidifier_setpoint_max = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::DehumidifierSetpointMax: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + dehumidifier_setpoint_max = json_payload.at("value").get(); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_max_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + dehumidifier_setpoint_max + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_dehumidifier_setpoint_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + int32_t dehumidifier_setpoint = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::DehumidifierSetpoint: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + dehumidifier_setpoint = json_payload.at("value").get(); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + dehumidifier_setpoint + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_dehumidifier_setpoint_scale_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_scale_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + ScaleType dehumidifier_setpoint_scale = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::DehumidifierSetpointScale: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + uint32_t tmp = get_enum_decimal_value("value", json_payload); + if (tmp == numeric_limits::max()) { + #ifdef UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE_ENUM_NAME_AVAILABLE + tmp = unify_humidity_control_dehumidifier_setpoint_scale_get_enum_value_number(json_payload.at("value").get()); + #elif defined(DEHUMIDIFIER_SETPOINT_SCALE_ENUM_NAME_AVAILABLE) + tmp = dehumidifier_setpoint_scale_get_enum_value_number(json_payload.at("value").get()); + #endif + } + dehumidifier_setpoint_scale = static_cast(tmp); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_scale_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + dehumidifier_setpoint_scale + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_dehumidifier_setpoint_precision_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_precision_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + uint8_t dehumidifier_setpoint_precision = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::DehumidifierSetpointPrecision: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + dehumidifier_setpoint_precision = json_payload.at("value").get(); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_precision_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + dehumidifier_setpoint_precision + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_auto_setpoint_min_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_min_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + int32_t auto_setpoint_min = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::AutoSetpointMin: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + auto_setpoint_min = json_payload.at("value").get(); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_min_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + auto_setpoint_min + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_auto_setpoint_max_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_max_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + int32_t auto_setpoint_max = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::AutoSetpointMax: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + auto_setpoint_max = json_payload.at("value").get(); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_max_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + auto_setpoint_max + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_auto_setpoint_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + int32_t auto_setpoint = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::AutoSetpoint: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + auto_setpoint = json_payload.at("value").get(); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + auto_setpoint + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_auto_setpoint_scale_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_scale_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + ScaleType auto_setpoint_scale = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::AutoSetpointScale: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + uint32_t tmp = get_enum_decimal_value("value", json_payload); + if (tmp == numeric_limits::max()) { + #ifdef UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE_ENUM_NAME_AVAILABLE + tmp = unify_humidity_control_auto_setpoint_scale_get_enum_value_number(json_payload.at("value").get()); + #elif defined(AUTO_SETPOINT_SCALE_ENUM_NAME_AVAILABLE) + tmp = auto_setpoint_scale_get_enum_value_number(json_payload.at("value").get()); + #endif + } + auto_setpoint_scale = static_cast(tmp); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_scale_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + auto_setpoint_scale + ); + +} +static void uic_mqtt_dotdot_on_unify_humidity_control_auto_setpoint_precision_attribute_update( + const char *topic, + const char *message, + const size_t message_length) { + if (uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_precision_callback == nullptr) { + return; + } + + std::string unid; + uint8_t endpoint = 0; // Default value for endpoint-less topics. + if(! uic_dotdot_mqtt::parse_topic(topic,unid,endpoint)) { + sl_log_debug(LOG_TAG, + "Error parsing UNID / Endpoint ID from topic %s. Ignoring", + topic); + return; + } + + std::string last_item; + if (SL_STATUS_OK != uic_dotdot_mqtt::get_topic_last_item(topic,last_item)){ + sl_log_debug(LOG_TAG, + "Error parsing last item from topic %s. Ignoring", + topic); + return; + } + + uic_mqtt_dotdot_attribute_update_type_t update_type; + if (last_item == "Reported") { + update_type = UCL_REPORTED_UPDATED; + } else if (last_item == "Desired") { + update_type = UCL_DESIRED_UPDATED; + } else { + sl_log_debug(LOG_TAG, + "Unknown value type (neither Desired/Reported) for topic %s. Ignoring", + topic); + return; + } + + // Empty message means unretained value. + bool unretained = false; + if (message_length == 0) { + unretained = true; + } + + + uint8_t auto_setpoint_precision = {}; + + nlohmann::json json_payload; + try { + + if (unretained == false) { + json_payload = nlohmann::json::parse(std::string(message)); + + if (json_payload.find("value") == json_payload.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::AutoSetpointPrecision: Missing attribute element: 'value'\n"); + return; + } +// Start parsing value + auto_setpoint_precision = json_payload.at("value").get(); + + // End parsing value + } + + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "value", message); + return; + } + + uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_precision_callback( + static_cast(unid.c_str()), + endpoint, + unretained, + update_type, + auto_setpoint_precision + ); + +} + +/////////////////////////////////////////////////////////////////////////////// +// Attribute init functions for UnifyHumidityControl +/////////////////////////////////////////////////////////////////////////////// +sl_status_t uic_mqtt_dotdot_unify_humidity_control_attributes_init() +{ + std::string base_topic = "ucl/by-unid/+/+/"; + + std::string subscription_topic; + if(uic_mqtt_dotdot_unify_humidity_control_attribute_reporting_mode_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/ReportingMode/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_reporting_mode_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_supported_reporting_mode_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/SupportedReportingMode/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_supported_reporting_mode_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_current_state_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/CurrentState/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_current_state_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_supported_set_points_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/SupportedSetPoints/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_supported_set_points_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_min_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/HumidifierSetpointMin/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_humidifier_setpoint_min_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_max_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/HumidifierSetpointMax/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_humidifier_setpoint_max_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/HumidifierSetpoint/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_humidifier_setpoint_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_scale_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/HumidifierSetpointScale/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_humidifier_setpoint_scale_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_precision_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/HumidifierSetpointPrecision/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_humidifier_setpoint_precision_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_min_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/DehumidifierSetpointMin/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_dehumidifier_setpoint_min_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_max_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/DehumidifierSetpointMax/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_dehumidifier_setpoint_max_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/DehumidifierSetpoint/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_dehumidifier_setpoint_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_scale_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/DehumidifierSetpointScale/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_dehumidifier_setpoint_scale_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_precision_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/DehumidifierSetpointPrecision/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_dehumidifier_setpoint_precision_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_min_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/AutoSetpointMin/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_auto_setpoint_min_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_max_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/AutoSetpointMax/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_auto_setpoint_max_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/AutoSetpoint/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_auto_setpoint_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_scale_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/AutoSetpointScale/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_auto_setpoint_scale_attribute_update); + } + if(uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_precision_callback) { + subscription_topic = base_topic + "UnifyHumidityControl/Attributes/AutoSetpointPrecision/#"; + uic_mqtt_subscribe(subscription_topic.c_str(), &uic_mqtt_dotdot_on_unify_humidity_control_auto_setpoint_precision_attribute_update); + } + + return SL_STATUS_OK; +} + + +/////////////////////////////////////////////////////////////////////////////// +// Callback setters and getters for UnifyHumidityControl +/////////////////////////////////////////////////////////////////////////////// +void uic_mqtt_dotdot_unify_humidity_control_attribute_reporting_mode_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_reporting_mode_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_reporting_mode_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_supported_reporting_mode_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_supported_reporting_mode_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_supported_reporting_mode_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_current_state_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_current_state_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_current_state_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_supported_set_points_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_supported_set_points_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_supported_set_points_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_min_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_min_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_min_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_max_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_max_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_max_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_scale_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_scale_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_scale_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_precision_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_precision_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_humidifier_setpoint_precision_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_min_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_min_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_min_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_max_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_max_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_max_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_scale_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_scale_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_scale_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_precision_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_precision_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_dehumidifier_setpoint_precision_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_min_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_min_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_min_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_max_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_max_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_max_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_scale_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_scale_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_scale_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_precision_callback_set(const uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_precision_callback_t callback) +{ + uic_mqtt_dotdot_unify_humidity_control_attribute_auto_setpoint_precision_callback = callback; +} + +// End of supported cluster. + diff --git a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_command_helpers.cpp b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_command_helpers.cpp index 0ee153812..faafc7e32 100644 --- a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_command_helpers.cpp +++ b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_command_helpers.cpp @@ -14799,3 +14799,178 @@ void uic_mqtt_dotdot_parse_descriptor_write_attributes( } + +std::string get_json_payload_for_unify_humidity_control_mode_set_command( + + const uic_mqtt_dotdot_unify_humidity_control_command_mode_set_fields_t *fields + +){ + bool command_with_no_fields = true; + + // Create a JSON payload from all the parameters + nlohmann::json json_payload; + command_with_no_fields = false; + // Single Value + // Enum ModeSet / Mode + #ifdef MODE_SET_MODE_ENUM_NAME_AVAILABLE + // Pick up the name from the value. + json_payload["Mode"] = + mode_set_mode_get_enum_value_name( + (uint32_t)fields->mode); + #elif defined(MODE_TYPE_ENUM_NAME_AVAILABLE) + json_payload["Mode"] = + mode_type_get_enum_value_name((uint32_t)fields->mode); + #else + // If there is no name value for the enum, just write it directly. + json_payload["Mode"] = fields->mode; + #endif + + // Get the string + if (command_with_no_fields == true) { + return std::string("{}"); + } + // Payload may contain data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + return json_payload.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); +} + + +void uic_mqtt_dotdot_parse_unify_humidity_control_mode_set( + nlohmann::json &jsn, + ModeType &mode + +) { + + uint32_t Mode_enum_val = get_enum_decimal_value("Mode", jsn); + if (Mode_enum_val == std::numeric_limits::max()) { + #ifdef MODE_TYPE_ENUM_NAME_AVAILABLE + Mode_enum_val = mode_type_get_enum_value_number(jsn.at("Mode").get()); + #endif + } + if (jsn.at("Mode").is_null()) { + sl_log_debug(LOG_TAG, "Ignoring JSON Null object"); + return; + } + mode = static_cast(Mode_enum_val); +} + + +std::string get_json_payload_for_unify_humidity_control_setpoint_set_command( + + const uic_mqtt_dotdot_unify_humidity_control_command_setpoint_set_fields_t *fields + +){ + bool command_with_no_fields = true; + + // Create a JSON payload from all the parameters + nlohmann::json json_payload; + command_with_no_fields = false; + // Single Value + // Enum SetpointSet / Type + #ifdef SETPOINT_SET_TYPE_ENUM_NAME_AVAILABLE + // Pick up the name from the value. + json_payload["Type"] = + setpoint_set_type_get_enum_value_name( + (uint32_t)fields->type); + #elif defined(SETPOINT_TYPE_ENUM_NAME_AVAILABLE) + json_payload["Type"] = + setpoint_type_get_enum_value_name((uint32_t)fields->type); + #else + // If there is no name value for the enum, just write it directly. + json_payload["Type"] = fields->type; + #endif + command_with_no_fields = false; + // Single Value + // Non-enum and non-bitmask (struct, string or scalar) + json_payload["Precision"] = nlohmann::json(fields->precision); + command_with_no_fields = false; + // Single Value + // Non-enum and non-bitmask (struct, string or scalar) + json_payload["Scale"] = nlohmann::json(fields->scale); + command_with_no_fields = false; + // Single Value + // Non-enum and non-bitmask (struct, string or scalar) + json_payload["Value"] = nlohmann::json(fields->value); + + // Get the string + if (command_with_no_fields == true) { + return std::string("{}"); + } + // Payload may contain data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + return json_payload.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); +} + + +void uic_mqtt_dotdot_parse_unify_humidity_control_setpoint_set( + nlohmann::json &jsn, + SetpointType &type, + + uint8_t &precision, + + uint8_t &scale, + + int32_t &value + +) { + + uint32_t Type_enum_val = get_enum_decimal_value("Type", jsn); + if (Type_enum_val == std::numeric_limits::max()) { + #ifdef SETPOINT_TYPE_ENUM_NAME_AVAILABLE + Type_enum_val = setpoint_type_get_enum_value_number(jsn.at("Type").get()); + #endif + } + if (jsn.at("Type").is_null()) { + sl_log_debug(LOG_TAG, "Ignoring JSON Null object"); + return; + } + type = static_cast(Type_enum_val); + if (jsn.at("Precision").is_null()) { + sl_log_debug(LOG_TAG, "Ignoring JSON Null object"); + return; + } + + precision = jsn.at("Precision").get< uint8_t >(); + if (jsn.at("Scale").is_null()) { + sl_log_debug(LOG_TAG, "Ignoring JSON Null object"); + return; + } + + scale = jsn.at("Scale").get< uint8_t >(); + if (jsn.at("Value").is_null()) { + sl_log_debug(LOG_TAG, "Ignoring JSON Null object"); + return; + } + + value = jsn.at("Value").get< int32_t >(); + } + + +/** + * @brief JSON parser for ::WriteAttributes command arguments. + * + * Parse incoming JSON object to populate command arguments passed in by reference. + */ +void uic_mqtt_dotdot_parse_unify_humidity_control_write_attributes( + nlohmann::json &jsn, + uic_mqtt_dotdot_unify_humidity_control_state_t &new_state, + uic_mqtt_dotdot_unify_humidity_control_updated_state_t &new_updated_state +) { + + + if (jsn.find("ReportingMode") != jsn.end()) { + + uint32_t tmp = get_enum_decimal_value("ReportingMode", jsn); + if (tmp == std::numeric_limits::max()) { + #ifdef UNIFY_HUMIDITY_CONTROL_REPORTING_MODE_ENUM_NAME_AVAILABLE + tmp = unify_humidity_control_reporting_mode_get_enum_value_number(jsn.at("ReportingMode").get()); + #elif defined(REPORTING_MODE_ENUM_NAME_AVAILABLE) + tmp = reporting_mode_get_enum_value_number(jsn.at("ReportingMode").get()); + #endif + } + new_state.reporting_mode = tmp; + + new_updated_state.reporting_mode = true; + } + + +} + diff --git a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_command_helpers.hpp b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_command_helpers.hpp index 21f137181..43736077e 100644 --- a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_command_helpers.hpp +++ b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_command_helpers.hpp @@ -6071,6 +6071,80 @@ void uic_mqtt_dotdot_parse_descriptor_write_attributes( ); +/** + * @brief Private helper function that will create a JSON string based on the + * fields of a UnifyHumidityControl ModeSet command + * + * @param fields Struct pointer with the list of fields for the command + * + * @returns std::string that contains JSON payload + */ +std::string get_json_payload_for_unify_humidity_control_mode_set_command( + + const uic_mqtt_dotdot_unify_humidity_control_command_mode_set_fields_t *fields + +); + + +/** + * @brief JSON parser for UnifyHumidityControl ModeSet command arguments. + * + * Parse incoming JSON object to populate command arguments passed in by reference. + */ +void uic_mqtt_dotdot_parse_unify_humidity_control_mode_set( + nlohmann::json &jsn, + ModeType &mode + +); + + + +/** + * @brief Private helper function that will create a JSON string based on the + * fields of a UnifyHumidityControl SetpointSet command + * + * @param fields Struct pointer with the list of fields for the command + * + * @returns std::string that contains JSON payload + */ +std::string get_json_payload_for_unify_humidity_control_setpoint_set_command( + + const uic_mqtt_dotdot_unify_humidity_control_command_setpoint_set_fields_t *fields + +); + + +/** + * @brief JSON parser for UnifyHumidityControl SetpointSet command arguments. + * + * Parse incoming JSON object to populate command arguments passed in by reference. + */ +void uic_mqtt_dotdot_parse_unify_humidity_control_setpoint_set( + nlohmann::json &jsn, + SetpointType &type, + + uint8_t &precision, + + uint8_t &scale, + + int32_t &value + +); + + + +/** + * @brief JSON parser for UnifyHumidityControl WriteAttributes command arguments. + * + * Parse incoming JSON object to populate command arguments passed in by reference. + */ +void uic_mqtt_dotdot_parse_unify_humidity_control_write_attributes( + nlohmann::json &jsn, + uic_mqtt_dotdot_unify_humidity_control_state_t &new_state, + uic_mqtt_dotdot_unify_humidity_control_updated_state_t &new_updated_state +); + + #endif //DOTDOT_MQTT_COMMAND_HELPERS_HPP /** @} end dotdot_mqtt_command_helpers */ diff --git a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_generated_commands.cpp b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_generated_commands.cpp index a09f1a69c..767b675a1 100644 --- a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_generated_commands.cpp +++ b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_generated_commands.cpp @@ -11396,3 +11396,129 @@ void uic_mqtt_dotdot_descriptor_publish_generated_write_attributes_command( false); } +/** + * @brief Publishes an incoming/generated ModeSet command for + * the UnifyHumidityControl cluster. + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/GeneratedCommands/ModeSet + * + * @param unid The UNID of the node that sent us the command. + * + * @param endpoint The Endpoint ID of the node that sent us the command. + * + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_generated_mode_set_command( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint, + const uic_mqtt_dotdot_unify_humidity_control_command_mode_set_fields_t *fields + +) { + // Create the topic + std::string topic = "ucl/by-unid/"+ std::string(unid) + "/ep" + + std::to_string(endpoint) + "/"; + topic += "UnifyHumidityControl/GeneratedCommands/ModeSet"; + + std::string payload = + get_json_payload_for_unify_humidity_control_mode_set_command( + fields); + + // Publish our command + uic_mqtt_publish(topic.c_str(), + payload.c_str(), + payload.size(), + false); +} +/** + * @brief Publishes an incoming/generated SetpointSet command for + * the UnifyHumidityControl cluster. + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/GeneratedCommands/SetpointSet + * + * @param unid The UNID of the node that sent us the command. + * + * @param endpoint The Endpoint ID of the node that sent us the command. + * + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_generated_setpoint_set_command( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint, + const uic_mqtt_dotdot_unify_humidity_control_command_setpoint_set_fields_t *fields + +) { + // Create the topic + std::string topic = "ucl/by-unid/"+ std::string(unid) + "/ep" + + std::to_string(endpoint) + "/"; + topic += "UnifyHumidityControl/GeneratedCommands/SetpointSet"; + + std::string payload = + get_json_payload_for_unify_humidity_control_setpoint_set_command( + fields); + + // Publish our command + uic_mqtt_publish(topic.c_str(), + payload.c_str(), + payload.size(), + false); +} + + +/** + * @brief Publishes an incoming/generated WriteAttributes command for + * the UnifyHumidityControl cluster. + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/GeneratedCommands/WriteAttributes + * + * @param unid The UNID of the node that sent us the command. + * + * @param endpoint The Endpoint ID of the node that sent us the command. + * + * @param attribute_values Values to assign to the attributes + * @param attribute_list List of attributes that are written + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_generated_write_attributes_command( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint, + uic_mqtt_dotdot_unify_humidity_control_state_t attribute_values, + uic_mqtt_dotdot_unify_humidity_control_updated_state_t attribute_list +){ + // Create the topic + std::string topic = "ucl/by-unid/"+ std::string(unid) + "/ep" + + std::to_string(endpoint) + "/"; + topic += "UnifyHumidityControl/GeneratedCommands/WriteAttributes"; + + nlohmann::json json_object = nlohmann::json::object(); + + + if (attribute_list.reporting_mode == true) { + + // This is a single value + + #ifdef UNIFY_HUMIDITY_CONTROL_REPORTING_MODE_ENUM_NAME_AVAILABLE + json_object["ReportingMode"] = unify_humidity_control_reporting_mode_get_enum_value_name((uint32_t)attribute_values.reporting_mode); + #else + json_object["ReportingMode"] = static_cast(attribute_values.reporting_mode); + #endif + + + } + + + // Payload contains data from end nodes, which we cannot control, thus we handle if there are non-utf8 characters + std::string payload = json_object.dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); + + // Publish our command + uic_mqtt_publish(topic.c_str(), + payload.c_str(), + payload.size(), + false); +} + diff --git a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_group_commands.cpp b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_group_commands.cpp index 5d85d166d..040a7a29b 100644 --- a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_group_commands.cpp +++ b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_group_commands.cpp @@ -366,6 +366,11 @@ static uic_mqtt_dotdot_by_group_aox_position_estimation_write_attributes_callbac static uic_mqtt_dotdot_by_group_descriptor_write_attributes_callback_t uic_mqtt_dotdot_by_group_descriptor_write_attributes_callback = nullptr; +static uic_mqtt_dotdot_by_group_unify_humidity_control_mode_set_callback_t uic_mqtt_dotdot_by_group_unify_humidity_control_mode_set_callback = nullptr; +static uic_mqtt_dotdot_by_group_unify_humidity_control_setpoint_set_callback_t uic_mqtt_dotdot_by_group_unify_humidity_control_setpoint_set_callback = nullptr; +static uic_mqtt_dotdot_by_group_unify_humidity_control_write_attributes_callback_t uic_mqtt_dotdot_by_group_unify_humidity_control_write_attributes_callback = nullptr; + + // Callbacks setters @@ -1876,6 +1881,27 @@ void uic_mqtt_dotdot_by_group_descriptor_write_attributes_callback_set( +// Callbacks setters + +void uic_mqtt_dotdot_by_group_unify_humidity_control_mode_set_callback_set(const uic_mqtt_dotdot_by_group_unify_humidity_control_mode_set_callback_t callback) +{ + uic_mqtt_dotdot_by_group_unify_humidity_control_mode_set_callback = callback; +} + + +void uic_mqtt_dotdot_by_group_unify_humidity_control_setpoint_set_callback_set(const uic_mqtt_dotdot_by_group_unify_humidity_control_setpoint_set_callback_t callback) +{ + uic_mqtt_dotdot_by_group_unify_humidity_control_setpoint_set_callback = callback; +} + +void uic_mqtt_dotdot_by_group_unify_humidity_control_write_attributes_callback_set( + const uic_mqtt_dotdot_by_group_unify_humidity_control_write_attributes_callback_t callback) +{ + uic_mqtt_dotdot_by_group_unify_humidity_control_write_attributes_callback = callback; +} + + + // Callback function for incoming publications on ucl/by-group/+/Basic/Commands/ResetToFactoryDefaults static void uic_mqtt_dotdot_on_by_group_basic_reset_to_factory_defaults( @@ -23492,6 +23518,287 @@ sl_status_t uic_mqtt_dotdot_by_group_descriptor_init() + +// Callback function for incoming publications on ucl/by-group/+/UnifyHumidityControl/Commands/ModeSet +static void uic_mqtt_dotdot_on_by_group_unify_humidity_control_mode_set( + const char *topic, + const char *message, + const size_t message_length) +{ + if ((group_dispatch_callback == nullptr) && (uic_mqtt_dotdot_by_group_unify_humidity_control_mode_set_callback == nullptr)) { + return; + } + if (message_length == 0) { + return; + } + + dotdot_group_id_t group_id = 0U; + if(!uic_dotdot_mqtt::parse_topic_group_id(topic,group_id)) { + sl_log_debug(LOG_TAG, + "Failed to parse GroupId from topic %s. Ignoring", + topic); + return; + } + + // Pass to command-specific callback if set. Otherwise, pass to + // group-dispatch callback + if (uic_mqtt_dotdot_by_group_unify_humidity_control_mode_set_callback != nullptr) { + + + uic_mqtt_dotdot_unify_humidity_control_command_mode_set_fields_t fields; + + + nlohmann::json jsn; + try { + jsn = nlohmann::json::parse(std::string(message)); + + + uic_mqtt_dotdot_parse_unify_humidity_control_mode_set( + jsn, + fields.mode + ); + + // Populate list fields from vector or string types + + + } catch (const nlohmann::json::parse_error& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_PARSE_FAIL, "UnifyHumidityControl", "ModeSet"); + return; + } catch (const nlohmann::json::exception& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "ModeSet", e.what()); + return; + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "ModeSet", ""); + return; + } + + uic_mqtt_dotdot_by_group_unify_humidity_control_mode_set_callback( + group_id, + &fields + ); + } else if ((group_dispatch_callback != nullptr) && (!get_uic_mqtt_dotdot_unify_humidity_control_mode_set_callback().empty())) { + // group-dispatch callback only called if the command-specific by-unid + // callback is set + try { + nlohmann::json jsn = nlohmann::json::parse(std::string(message)); + if (jsn.find("Mode") == jsn.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::ModeSet: Missing command-argument: Mode\n"); + return; + } + + group_dispatch_callback( + group_id, + "UnifyHumidityControl", + "ModeSet", + message, + message_length, + uic_mqtt_dotdot_on_unify_humidity_control_mode_set); + + } catch (...) { + sl_log_debug(LOG_TAG, "ModeSet: Unable to parse JSON payload.\n"); + return; + } + } + +} + +// Callback function for incoming publications on ucl/by-group/+/UnifyHumidityControl/Commands/SetpointSet +static void uic_mqtt_dotdot_on_by_group_unify_humidity_control_setpoint_set( + const char *topic, + const char *message, + const size_t message_length) +{ + if ((group_dispatch_callback == nullptr) && (uic_mqtt_dotdot_by_group_unify_humidity_control_setpoint_set_callback == nullptr)) { + return; + } + if (message_length == 0) { + return; + } + + dotdot_group_id_t group_id = 0U; + if(!uic_dotdot_mqtt::parse_topic_group_id(topic,group_id)) { + sl_log_debug(LOG_TAG, + "Failed to parse GroupId from topic %s. Ignoring", + topic); + return; + } + + // Pass to command-specific callback if set. Otherwise, pass to + // group-dispatch callback + if (uic_mqtt_dotdot_by_group_unify_humidity_control_setpoint_set_callback != nullptr) { + + + uic_mqtt_dotdot_unify_humidity_control_command_setpoint_set_fields_t fields; + + + nlohmann::json jsn; + try { + jsn = nlohmann::json::parse(std::string(message)); + + + uic_mqtt_dotdot_parse_unify_humidity_control_setpoint_set( + jsn, + fields.type, + + fields.precision, + + fields.scale, + + fields.value + ); + + // Populate list fields from vector or string types + + + } catch (const nlohmann::json::parse_error& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_PARSE_FAIL, "UnifyHumidityControl", "SetpointSet"); + return; + } catch (const nlohmann::json::exception& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "SetpointSet", e.what()); + return; + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "SetpointSet", ""); + return; + } + + uic_mqtt_dotdot_by_group_unify_humidity_control_setpoint_set_callback( + group_id, + &fields + ); + } else if ((group_dispatch_callback != nullptr) && (!get_uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback().empty())) { + // group-dispatch callback only called if the command-specific by-unid + // callback is set + try { + nlohmann::json jsn = nlohmann::json::parse(std::string(message)); + if (jsn.find("Type") == jsn.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::SetpointSet: Missing command-argument: Type\n"); + return; + } + if (jsn.find("Precision") == jsn.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::SetpointSet: Missing command-argument: Precision\n"); + return; + } + if (jsn.find("Scale") == jsn.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::SetpointSet: Missing command-argument: Scale\n"); + return; + } + if (jsn.find("Value") == jsn.end()) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl::SetpointSet: Missing command-argument: Value\n"); + return; + } + + group_dispatch_callback( + group_id, + "UnifyHumidityControl", + "SetpointSet", + message, + message_length, + uic_mqtt_dotdot_on_unify_humidity_control_setpoint_set); + + } catch (...) { + sl_log_debug(LOG_TAG, "SetpointSet: Unable to parse JSON payload.\n"); + return; + } + } + +} + +static void uic_mqtt_dotdot_on_by_group_unify_humidity_control_WriteAttributes( + const char *topic, + const char *message, + const size_t message_length) +{ + + if ((group_dispatch_callback == nullptr) && (uic_mqtt_dotdot_by_group_unify_humidity_control_write_attributes_callback == nullptr)) { + return; + } + if (message_length == 0) { + return; + } + + dotdot_group_id_t group_id = 0U; + if(!uic_dotdot_mqtt::parse_topic_group_id(topic,group_id)) { + sl_log_debug(LOG_TAG, + "Failed to parse GroupId from topic %s. Ignoring", + topic); + return; + } + + if ((group_dispatch_callback != nullptr) && (!get_uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback().empty())) { + try { + group_dispatch_callback(group_id, + "UnifyHumidityControl", + "WriteAttributes", + message, + message_length, + uic_mqtt_dotdot_on_unify_humidity_control_WriteAttributes); + + } catch (...) { + sl_log_debug(LOG_TAG, "UnifyHumidityControl: Unable to parse JSON payload.\n"); + return; + } + } else if (uic_mqtt_dotdot_by_group_unify_humidity_control_write_attributes_callback != nullptr) { + + uic_mqtt_dotdot_unify_humidity_control_state_t new_state = {}; + uic_mqtt_dotdot_unify_humidity_control_updated_state_t new_updated_state = {}; + + + nlohmann::json jsn; + try { + jsn = nlohmann::json::parse(std::string(message)); + + uic_mqtt_dotdot_parse_unify_humidity_control_write_attributes( + jsn, + new_state, + new_updated_state + ); + } catch (const nlohmann::json::parse_error& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_PARSE_FAIL, "UnifyHumidityControl", "WriteAttributes"); + return; + } catch (const nlohmann::json::exception& e) { + // Catch JSON object field parsing errors + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "WriteAttributes", e.what()); + return; + } catch (const std::exception& e) { + sl_log_debug(LOG_TAG, LOG_FMT_JSON_ERROR, "UnifyHumidityControl", "WriteAttributes", ""); + return; + } + + uic_mqtt_dotdot_by_group_unify_humidity_control_write_attributes_callback( + group_id, + new_state, + new_updated_state + ); + } +} + +sl_status_t uic_mqtt_dotdot_by_group_unify_humidity_control_init() +{ + std::string subscription_topic; + const std::string topic_bygroup = TOPIC_BY_GROUP_PREFIX; + if(uic_mqtt_dotdot_by_group_unify_humidity_control_write_attributes_callback) { + subscription_topic = topic_bygroup + "UnifyHumidityControl/Commands/WriteAttributes"; + uic_mqtt_subscribe(subscription_topic.c_str(), uic_mqtt_dotdot_on_by_group_unify_humidity_control_WriteAttributes); + } + if (uic_mqtt_dotdot_by_group_unify_humidity_control_mode_set_callback) { + subscription_topic = topic_bygroup + "UnifyHumidityControl/Commands/ModeSet"; + uic_mqtt_subscribe(subscription_topic.c_str(), uic_mqtt_dotdot_on_by_group_unify_humidity_control_mode_set); + } + if (uic_mqtt_dotdot_by_group_unify_humidity_control_setpoint_set_callback) { + subscription_topic = topic_bygroup + "UnifyHumidityControl/Commands/SetpointSet"; + uic_mqtt_subscribe(subscription_topic.c_str(), uic_mqtt_dotdot_on_by_group_unify_humidity_control_setpoint_set); + } + + return SL_STATUS_OK; +} + + + void uic_mqtt_dotdot_set_group_dispatch_callback(group_dispatch_t callback) { // Check for uninitialized value in order to subscribe with on_group handlers @@ -23773,6 +24080,10 @@ void uic_mqtt_dotdot_set_group_dispatch_callback(group_dispatch_t callback) uic_mqtt_subscribe("ucl/by-group/+/Descriptor/Commands/WriteAttributes", uic_mqtt_dotdot_on_by_group_descriptor_WriteAttributes); + uic_mqtt_subscribe("ucl/by-group/+/UnifyHumidityControl/Commands/WriteAttributes", uic_mqtt_dotdot_on_by_group_unify_humidity_control_WriteAttributes); + uic_mqtt_subscribe("ucl/by-group/+/UnifyHumidityControl/Commands/ModeSet", uic_mqtt_dotdot_on_by_group_unify_humidity_control_mode_set); + uic_mqtt_subscribe("ucl/by-group/+/UnifyHumidityControl/Commands/SetpointSet", uic_mqtt_dotdot_on_by_group_unify_humidity_control_setpoint_set); + } group_dispatch_callback = callback; diff --git a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_helpers.cpp b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_helpers.cpp index e777d585a..02814ecf9 100644 --- a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_helpers.cpp +++ b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_helpers.cpp @@ -3308,6 +3308,47 @@ uint32_t metering_unitof_measure_get_enum_value_number(const std::string &str) return std::numeric_limits::max(); } +// Enum to string map for ModeType +const std::map mode_type_enum_id_to_string_map { + { 0, "Off" }, + { 1, "Humidify" }, + { 2, "Dehumidify" }, + { 3, "Auto" }, +}; + +// String to enum map for ModeType +const std::map mode_type_enum_string_to_id_map { + { "Off", 0 }, + { "Humidify", 1 }, + { "Dehumidify", 2 }, + { "Auto", 3 }, +}; + +std::string mode_type_get_enum_value_name( + uint32_t value) +{ + auto it = mode_type_enum_id_to_string_map.find(value); + if (it != mode_type_enum_id_to_string_map.end()){ + return it->second; + } + + // No known name value is set for this field. + // Set it to a string version of the value. + return std::to_string(value); +} + +uint32_t mode_type_get_enum_value_number(const std::string &str) +{ + auto it = mode_type_enum_string_to_id_map.find(str); + if (it != mode_type_enum_string_to_id_map.end()){ + return it->second; + } + + // No known numeric value is set for this string. + // Return UINT32_MAX to indicate an error. + return std::numeric_limits::max(); +} + // Enum to string map for MoveStepMode const std::map move_step_mode_enum_id_to_string_map { { 0, "Up" }, @@ -4131,6 +4172,43 @@ uint32_t shdcfg_direction_get_enum_value_number(const std::string &str) return std::numeric_limits::max(); } +// Enum to string map for ScaleType +const std::map scale_type_enum_id_to_string_map { + { 0, "Percentage" }, + { 1, "Absolute" }, +}; + +// String to enum map for ScaleType +const std::map scale_type_enum_string_to_id_map { + { "Percentage", 0 }, + { "Absolute", 1 }, +}; + +std::string scale_type_get_enum_value_name( + uint32_t value) +{ + auto it = scale_type_enum_id_to_string_map.find(value); + if (it != scale_type_enum_id_to_string_map.end()){ + return it->second; + } + + // No known name value is set for this field. + // Set it to a string version of the value. + return std::to_string(value); +} + +uint32_t scale_type_get_enum_value_number(const std::string &str) +{ + auto it = scale_type_enum_string_to_id_map.find(str); + if (it != scale_type_enum_string_to_id_map.end()){ + return it->second; + } + + // No known numeric value is set for this string. + // Return UINT32_MAX to indicate an error. + return std::numeric_limits::max(); +} + // Enum to string map for SetpointRaiseOrLowerMode const std::map setpoint_raise_or_lower_mode_enum_id_to_string_map { { 0, "Heat" }, @@ -4170,6 +4248,45 @@ uint32_t setpoint_raise_or_lower_mode_get_enum_value_number(const std::string &s return std::numeric_limits::max(); } +// Enum to string map for SetpointType +const std::map setpoint_type_enum_id_to_string_map { + { 1, "Humidifier" }, + { 2, "Dehumidifier" }, + { 3, "Auto" }, +}; + +// String to enum map for SetpointType +const std::map setpoint_type_enum_string_to_id_map { + { "Humidifier", 1 }, + { "Dehumidifier", 2 }, + { "Auto", 3 }, +}; + +std::string setpoint_type_get_enum_value_name( + uint32_t value) +{ + auto it = setpoint_type_enum_id_to_string_map.find(value); + if (it != setpoint_type_enum_id_to_string_map.end()){ + return it->second; + } + + // No known name value is set for this field. + // Set it to a string version of the value. + return std::to_string(value); +} + +uint32_t setpoint_type_get_enum_value_number(const std::string &str) +{ + auto it = setpoint_type_enum_string_to_id_map.find(str); + if (it != setpoint_type_enum_string_to_id_map.end()){ + return it->second; + } + + // No known numeric value is set for this string. + // Return UINT32_MAX to indicate an error. + return std::numeric_limits::max(); +} + // Enum to string map for ShadeConfigurationMode const std::map shade_configuration_mode_enum_id_to_string_map { { 0, "Normal" }, @@ -5064,6 +5181,45 @@ uint32_t tx_report_transmission_speed_get_enum_value_number(const std::string &s return std::numeric_limits::max(); } +// Enum to string map for UnifyHumidityControlCurrentState +const std::map unify_humidity_control_current_state_enum_id_to_string_map { + { 0, "Idle" }, + { 1, "Humidifying" }, + { 2, "Dehumidifying" }, +}; + +// String to enum map for UnifyHumidityControlCurrentState +const std::map unify_humidity_control_current_state_enum_string_to_id_map { + { "Idle", 0 }, + { "Humidifying", 1 }, + { "Dehumidifying", 2 }, +}; + +std::string unify_humidity_control_current_state_get_enum_value_name( + uint32_t value) +{ + auto it = unify_humidity_control_current_state_enum_id_to_string_map.find(value); + if (it != unify_humidity_control_current_state_enum_id_to_string_map.end()){ + return it->second; + } + + // No known name value is set for this field. + // Set it to a string version of the value. + return std::to_string(value); +} + +uint32_t unify_humidity_control_current_state_get_enum_value_number(const std::string &str) +{ + auto it = unify_humidity_control_current_state_enum_string_to_id_map.find(str); + if (it != unify_humidity_control_current_state_enum_string_to_id_map.end()){ + return it->second; + } + + // No known numeric value is set for this string. + // Return UINT32_MAX to indicate an error. + return std::numeric_limits::max(); +} + // Enum to string map for WindowCoveringWindowCoveringType const std::map window_covering_window_covering_type_enum_id_to_string_map { { 0, "Rollershade" }, @@ -9908,6 +10064,123 @@ std::string get_enum_value_name( #endif } + if (64928 == cluster_id) { + #ifdef UNIFY_HUMIDITY_CONTROL_REPORTING_MODE_ENUM_NAME_AVAILABLE + if (1 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlreporting_mode instead of this: unify_humidity_control_reporting_mode + return unify_humidity_control_reporting_mode_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE_ENUM_NAME_AVAILABLE + if (2 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlsupported_reporting_mode instead of this: unify_humidity_control_supported_reporting_mode + return unify_humidity_control_supported_reporting_mode_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_CURRENT_STATE_ENUM_NAME_AVAILABLE + if (3 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlcurrent_state instead of this: unify_humidity_control_current_state + return unify_humidity_control_current_state_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS_ENUM_NAME_AVAILABLE + if (4 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlsupported_set_points instead of this: unify_humidity_control_supported_set_points + return unify_humidity_control_supported_set_points_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN_ENUM_NAME_AVAILABLE + if (5 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlhumidifier_setpoint_min instead of this: unify_humidity_control_humidifier_setpoint_min + return unify_humidity_control_humidifier_setpoint_min_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX_ENUM_NAME_AVAILABLE + if (6 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlhumidifier_setpoint_max instead of this: unify_humidity_control_humidifier_setpoint_max + return unify_humidity_control_humidifier_setpoint_max_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_ENUM_NAME_AVAILABLE + if (7 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlhumidifier_setpoint instead of this: unify_humidity_control_humidifier_setpoint + return unify_humidity_control_humidifier_setpoint_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE_ENUM_NAME_AVAILABLE + if (8 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlhumidifier_setpoint_scale instead of this: unify_humidity_control_humidifier_setpoint_scale + return unify_humidity_control_humidifier_setpoint_scale_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION_ENUM_NAME_AVAILABLE + if (9 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlhumidifier_setpoint_precision instead of this: unify_humidity_control_humidifier_setpoint_precision + return unify_humidity_control_humidifier_setpoint_precision_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN_ENUM_NAME_AVAILABLE + if (10 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controldehumidifier_setpoint_min instead of this: unify_humidity_control_dehumidifier_setpoint_min + return unify_humidity_control_dehumidifier_setpoint_min_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX_ENUM_NAME_AVAILABLE + if (11 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controldehumidifier_setpoint_max instead of this: unify_humidity_control_dehumidifier_setpoint_max + return unify_humidity_control_dehumidifier_setpoint_max_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_ENUM_NAME_AVAILABLE + if (12 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controldehumidifier_setpoint instead of this: unify_humidity_control_dehumidifier_setpoint + return unify_humidity_control_dehumidifier_setpoint_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE_ENUM_NAME_AVAILABLE + if (13 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controldehumidifier_setpoint_scale instead of this: unify_humidity_control_dehumidifier_setpoint_scale + return unify_humidity_control_dehumidifier_setpoint_scale_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION_ENUM_NAME_AVAILABLE + if (14 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controldehumidifier_setpoint_precision instead of this: unify_humidity_control_dehumidifier_setpoint_precision + return unify_humidity_control_dehumidifier_setpoint_precision_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN_ENUM_NAME_AVAILABLE + if (15 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlauto_setpoint_min instead of this: unify_humidity_control_auto_setpoint_min + return unify_humidity_control_auto_setpoint_min_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX_ENUM_NAME_AVAILABLE + if (16 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlauto_setpoint_max instead of this: unify_humidity_control_auto_setpoint_max + return unify_humidity_control_auto_setpoint_max_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_ENUM_NAME_AVAILABLE + if (17 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlauto_setpoint instead of this: unify_humidity_control_auto_setpoint + return unify_humidity_control_auto_setpoint_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE_ENUM_NAME_AVAILABLE + if (18 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlauto_setpoint_scale instead of this: unify_humidity_control_auto_setpoint_scale + return unify_humidity_control_auto_setpoint_scale_get_enum_value_name(value); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION_ENUM_NAME_AVAILABLE + if (19 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlauto_setpoint_precision instead of this: unify_humidity_control_auto_setpoint_precision + return unify_humidity_control_auto_setpoint_precision_get_enum_value_name(value); + } + #endif + } + std::string value_name; return value_name; @@ -14376,6 +14649,123 @@ uint32_t get_enum_name_value( #endif } + if (64928 == cluster_id) { + #ifdef UNIFY_HUMIDITY_CONTROL_REPORTING_MODE_ENUM_NAME_AVAILABLE + if (1 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlreporting_mode instead of this: unify_humidity_control_reporting_mode + return unify_humidity_control_reporting_mode_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE_ENUM_NAME_AVAILABLE + if (2 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlsupported_reporting_mode instead of this: unify_humidity_control_supported_reporting_mode + return unify_humidity_control_supported_reporting_mode_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_CURRENT_STATE_ENUM_NAME_AVAILABLE + if (3 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlcurrent_state instead of this: unify_humidity_control_current_state + return unify_humidity_control_current_state_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS_ENUM_NAME_AVAILABLE + if (4 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlsupported_set_points instead of this: unify_humidity_control_supported_set_points + return unify_humidity_control_supported_set_points_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN_ENUM_NAME_AVAILABLE + if (5 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlhumidifier_setpoint_min instead of this: unify_humidity_control_humidifier_setpoint_min + return unify_humidity_control_humidifier_setpoint_min_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX_ENUM_NAME_AVAILABLE + if (6 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlhumidifier_setpoint_max instead of this: unify_humidity_control_humidifier_setpoint_max + return unify_humidity_control_humidifier_setpoint_max_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_ENUM_NAME_AVAILABLE + if (7 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlhumidifier_setpoint instead of this: unify_humidity_control_humidifier_setpoint + return unify_humidity_control_humidifier_setpoint_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE_ENUM_NAME_AVAILABLE + if (8 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlhumidifier_setpoint_scale instead of this: unify_humidity_control_humidifier_setpoint_scale + return unify_humidity_control_humidifier_setpoint_scale_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION_ENUM_NAME_AVAILABLE + if (9 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlhumidifier_setpoint_precision instead of this: unify_humidity_control_humidifier_setpoint_precision + return unify_humidity_control_humidifier_setpoint_precision_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN_ENUM_NAME_AVAILABLE + if (10 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controldehumidifier_setpoint_min instead of this: unify_humidity_control_dehumidifier_setpoint_min + return unify_humidity_control_dehumidifier_setpoint_min_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX_ENUM_NAME_AVAILABLE + if (11 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controldehumidifier_setpoint_max instead of this: unify_humidity_control_dehumidifier_setpoint_max + return unify_humidity_control_dehumidifier_setpoint_max_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_ENUM_NAME_AVAILABLE + if (12 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controldehumidifier_setpoint instead of this: unify_humidity_control_dehumidifier_setpoint + return unify_humidity_control_dehumidifier_setpoint_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE_ENUM_NAME_AVAILABLE + if (13 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controldehumidifier_setpoint_scale instead of this: unify_humidity_control_dehumidifier_setpoint_scale + return unify_humidity_control_dehumidifier_setpoint_scale_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION_ENUM_NAME_AVAILABLE + if (14 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controldehumidifier_setpoint_precision instead of this: unify_humidity_control_dehumidifier_setpoint_precision + return unify_humidity_control_dehumidifier_setpoint_precision_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN_ENUM_NAME_AVAILABLE + if (15 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlauto_setpoint_min instead of this: unify_humidity_control_auto_setpoint_min + return unify_humidity_control_auto_setpoint_min_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX_ENUM_NAME_AVAILABLE + if (16 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlauto_setpoint_max instead of this: unify_humidity_control_auto_setpoint_max + return unify_humidity_control_auto_setpoint_max_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_ENUM_NAME_AVAILABLE + if (17 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlauto_setpoint instead of this: unify_humidity_control_auto_setpoint + return unify_humidity_control_auto_setpoint_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE_ENUM_NAME_AVAILABLE + if (18 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlauto_setpoint_scale instead of this: unify_humidity_control_auto_setpoint_scale + return unify_humidity_control_auto_setpoint_scale_get_enum_value_number(name); + } + #endif + #ifdef UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION_ENUM_NAME_AVAILABLE + if (19 == attribute_id) { + // FIXME: Some attributes don't work because multi-upper case names end up like this: unify_humidity_controlauto_setpoint_precision instead of this: unify_humidity_control_auto_setpoint_precision + return unify_humidity_control_auto_setpoint_precision_get_enum_value_number(name); + } + #endif + } + // No known numeric value is set for this string. // Return UINT32_MAX to indicate an error. @@ -15154,6 +15544,17 @@ uint32_t metering_unitof_measure_get_enum_value_number_c(const char *str) { return metering_unitof_measure_get_enum_value_number(std::string(str)); } +char *mode_type_get_enum_value_name_c( + uint32_t value, char *result, size_t max_result_size) +{ + snprintf(result, max_result_size, "%s", mode_type_get_enum_value_name(value).c_str()); + return result; +} + +uint32_t mode_type_get_enum_value_number_c(const char *str) +{ + return mode_type_get_enum_value_number(std::string(str)); +} char *move_step_mode_get_enum_value_name_c( uint32_t value, char *result, size_t max_result_size) { @@ -15363,6 +15764,17 @@ uint32_t shdcfg_direction_get_enum_value_number_c(const char *str) { return shdcfg_direction_get_enum_value_number(std::string(str)); } +char *scale_type_get_enum_value_name_c( + uint32_t value, char *result, size_t max_result_size) +{ + snprintf(result, max_result_size, "%s", scale_type_get_enum_value_name(value).c_str()); + return result; +} + +uint32_t scale_type_get_enum_value_number_c(const char *str) +{ + return scale_type_get_enum_value_number(std::string(str)); +} char *setpoint_raise_or_lower_mode_get_enum_value_name_c( uint32_t value, char *result, size_t max_result_size) { @@ -15374,6 +15786,17 @@ uint32_t setpoint_raise_or_lower_mode_get_enum_value_number_c(const char *str) { return setpoint_raise_or_lower_mode_get_enum_value_number(std::string(str)); } +char *setpoint_type_get_enum_value_name_c( + uint32_t value, char *result, size_t max_result_size) +{ + snprintf(result, max_result_size, "%s", setpoint_type_get_enum_value_name(value).c_str()); + return result; +} + +uint32_t setpoint_type_get_enum_value_number_c(const char *str) +{ + return setpoint_type_get_enum_value_number(std::string(str)); +} char *shade_configuration_mode_get_enum_value_name_c( uint32_t value, char *result, size_t max_result_size) { @@ -15616,6 +16039,17 @@ uint32_t tx_report_transmission_speed_get_enum_value_number_c(const char *str) { return tx_report_transmission_speed_get_enum_value_number(std::string(str)); } +char *unify_humidity_control_current_state_get_enum_value_name_c( + uint32_t value, char *result, size_t max_result_size) +{ + snprintf(result, max_result_size, "%s", unify_humidity_control_current_state_get_enum_value_name(value).c_str()); + return result; +} + +uint32_t unify_humidity_control_current_state_get_enum_value_number_c(const char *str) +{ + return unify_humidity_control_current_state_get_enum_value_number(std::string(str)); +} char *window_covering_window_covering_type_get_enum_value_name_c( uint32_t value, char *result, size_t max_result_size) { diff --git a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_send_commands.cpp b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_send_commands.cpp index 92d7b490b..8e9b9d5e3 100644 --- a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_send_commands.cpp +++ b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_send_commands.cpp @@ -13727,3 +13727,151 @@ void uic_mqtt_dotdot_protocol_controller_network_management_publish_write_comman payload.size(), false); } + +/** + * @brief Sends/Publishes a ModeSet command for + * the UnifyHumidityControl cluster to a destination. + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/Commands/ModeSet + * + * @param destination_unid The UNID of the node that should receive the command. + * + * @param destination_endpoint The Endpoint ID of the node that should receive the command. + * + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_mode_set_command( + const dotdot_unid_t destination_unid, + const dotdot_endpoint_id_t destination_endpoint, + const uic_mqtt_dotdot_unify_humidity_control_command_mode_set_fields_t *fields + +) { + // Create the topic + std::string topic = "ucl/by-unid/"+ std::string(destination_unid) + "/ep" + + std::to_string(destination_endpoint) + "/"; + topic += "UnifyHumidityControl/Commands/ModeSet"; + + + std::string payload = + get_json_payload_for_unify_humidity_control_mode_set_command( + fields); + + sl_log_debug(LOG_TAG, "Sending command to %s with payload %s ---", topic.c_str() , payload.c_str()); + + // Publish our command, not retained + uic_mqtt_publish(topic.c_str(), + payload.c_str(), + payload.size(), + false); +} + +/** + * @brief Sends/Publishes a ModeSet command for + * the UnifyHumidityControl cluster to a group. + * + * Publication will be made at the following topic + * ucl/by-group/GroupID/UnifyHumidityControl/Commands/ModeSet + * + * @param destination_group_id The GroupID that should receive the command. + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_mode_set_command_to_group( + uint16_t destination_group_id, + const uic_mqtt_dotdot_unify_humidity_control_command_mode_set_fields_t *fields + +){ + // Create the topic + std::string topic = "ucl/by-group/"+ std::to_string(destination_group_id) + + "/UnifyHumidityControl/Commands/ModeSet"; + + std::string payload = + get_json_payload_for_unify_humidity_control_mode_set_command( + fields); + + sl_log_info(LOG_TAG, "Sending group command to %s with payload %s ---", topic.c_str() , payload.c_str()); + + // Publish our command, not retained + uic_mqtt_publish(topic.c_str(), + payload.c_str(), + payload.size(), + false); +} + +/** + * @brief Sends/Publishes a SetpointSet command for + * the UnifyHumidityControl cluster to a destination. + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/Commands/SetpointSet + * + * @param destination_unid The UNID of the node that should receive the command. + * + * @param destination_endpoint The Endpoint ID of the node that should receive the command. + * + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_setpoint_set_command( + const dotdot_unid_t destination_unid, + const dotdot_endpoint_id_t destination_endpoint, + const uic_mqtt_dotdot_unify_humidity_control_command_setpoint_set_fields_t *fields + +) { + // Create the topic + std::string topic = "ucl/by-unid/"+ std::string(destination_unid) + "/ep" + + std::to_string(destination_endpoint) + "/"; + topic += "UnifyHumidityControl/Commands/SetpointSet"; + + + std::string payload = + get_json_payload_for_unify_humidity_control_setpoint_set_command( + fields); + + sl_log_debug(LOG_TAG, "Sending command to %s with payload %s ---", topic.c_str() , payload.c_str()); + + // Publish our command, not retained + uic_mqtt_publish(topic.c_str(), + payload.c_str(), + payload.size(), + false); +} + +/** + * @brief Sends/Publishes a SetpointSet command for + * the UnifyHumidityControl cluster to a group. + * + * Publication will be made at the following topic + * ucl/by-group/GroupID/UnifyHumidityControl/Commands/SetpointSet + * + * @param destination_group_id The GroupID that should receive the command. + * + * @param fields Struct pointer with the fields value of the command + * + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_setpoint_set_command_to_group( + uint16_t destination_group_id, + const uic_mqtt_dotdot_unify_humidity_control_command_setpoint_set_fields_t *fields + +){ + // Create the topic + std::string topic = "ucl/by-group/"+ std::to_string(destination_group_id) + + "/UnifyHumidityControl/Commands/SetpointSet"; + + std::string payload = + get_json_payload_for_unify_humidity_control_setpoint_set_command( + fields); + + sl_log_info(LOG_TAG, "Sending group command to %s with payload %s ---", topic.c_str() , payload.c_str()); + + // Publish our command, not retained + uic_mqtt_publish(topic.c_str(), + payload.c_str(), + payload.size(), + false); +} diff --git a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_supported_generated_commands.cpp b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_supported_generated_commands.cpp index a2d5d754d..1a879ce4c 100644 --- a/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_supported_generated_commands.cpp +++ b/components/uic_dotdot_mqtt/zap-generated/src/dotdot_mqtt_supported_generated_commands.cpp @@ -2812,3 +2812,52 @@ void uic_mqtt_dotdot_descriptor_publish_supported_generated_commands( } + +/** + * @brief Sends/Publishes a the SupportedGenerated commands for + * the UnifyHumidityControl cluster for a UNID/Endpoint + * + * Publication will be made at the following topic + * ucl/by-unid/UNID/epID/UnifyHumidityControl/SupportedGeneratedCommands + * + * @param unid The UNID of the node on behalf of which the advertisment is made + * + * @param endpoint The Endpoint ID of the node on behalf of which the advertisment is made + * + * @param command_list Struct pointer with the fields value indicating if + * individual commands can be generated. + */ +void uic_mqtt_dotdot_unify_humidity_control_publish_supported_generated_commands( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint, + const uic_mqtt_dotdot_unify_humidity_control_supported_commands_t *command_list) +{ + std::string topic = "ucl/by-unid/" + std::string(unid); + topic += "/ep"+ std::to_string(endpoint); + topic += "/UnifyHumidityControl/SupportedGeneratedCommands"; + + // Assemble of vector of strings for the Supported Commands: + std::vector command_vector; + if (command_list->mode_set == true) { + command_vector.emplace_back("ModeSet"); + } + if (command_list->setpoint_set == true) { + command_vector.emplace_back("SetpointSet"); + } + if (command_list->write_attributes == true) { + command_vector.emplace_back("WriteAttributes"); + } + + // JSONify, then Stringify + nlohmann::json json_payload; + json_payload["value"] = command_vector; + std::string string_payload = json_payload.dump(); + + // Publish to MQTT + uic_mqtt_publish(topic.c_str(), + string_payload.c_str(), + string_payload.length(), + true); + +} + diff --git a/components/uic_dotdot_mqtt/zap-generated/test/dotdot_mqtt_test.include b/components/uic_dotdot_mqtt/zap-generated/test/dotdot_mqtt_test.include index 4884cdd28..8cf9f89af 100644 --- a/components/uic_dotdot_mqtt/zap-generated/test/dotdot_mqtt_test.include +++ b/components/uic_dotdot_mqtt/zap-generated/test/dotdot_mqtt_test.include @@ -3020,6 +3020,38 @@ static sl_status_t uic_mqtt_dotdot_protocol_controller_network_management_write_ return SL_STATUS_OK; } +static unsigned int uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_count; +static sl_status_t uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_func( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + uic_mqtt_dotdot_callback_call_type_t callback_type, + ModeType mode + +) { + uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_count++; + num_command_callbacks++; + return SL_STATUS_OK; +} + +static unsigned int uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_count; +static sl_status_t uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_func( + dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint, + uic_mqtt_dotdot_callback_call_type_t callback_type, + SetpointType type, + + uint8_t precision, + + uint8_t scale, + + int32_t value + +) { + uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_count++; + num_command_callbacks++; + return SL_STATUS_OK; +} + static unsigned int set_all_callbacks() { unsigned int num_callbacks = 0; @@ -3402,6 +3434,10 @@ static unsigned int set_all_callbacks() num_callbacks++; uic_mqtt_dotdot_protocol_controller_network_management_write_callback_set(&uic_mqtt_dotdot_protocol_controller_network_management_write_callback_func); num_callbacks++; + uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_set(&uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_func); + num_callbacks++; + uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_set(&uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_func); + num_callbacks++; return num_callbacks; } @@ -3649,6 +3685,9 @@ static void unset_all_callbacks() uic_mqtt_dotdot_protocol_controller_network_management_write_callback_clear(); uic_mqtt_dotdot_clear_protocol_controller_network_management_write_attributes_callbacks(); uic_mqtt_dotdot_clear_descriptor_write_attributes_callbacks(); + uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_clear(); + uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_clear(); + uic_mqtt_dotdot_clear_unify_humidity_control_write_attributes_callbacks(); } static void reset_callback_counters() @@ -3843,4 +3882,6 @@ static void reset_callback_counters() uic_mqtt_dotdot_aox_locator_angle_report_callback_count = 0; uic_mqtt_dotdot_aox_locator_angle_correction_callback_count = 0; uic_mqtt_dotdot_protocol_controller_network_management_write_callback_count = 0; + uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_count = 0; + uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_count = 0; } diff --git a/components/unify_dotdot_attribute_store/zap-generated/include/dotdot_attributes.uam b/components/unify_dotdot_attribute_store/zap-generated/include/dotdot_attributes.uam index 88967fac0..a47622528 100644 --- a/components/unify_dotdot_attribute_store/zap-generated/include/dotdot_attributes.uam +++ b/components/unify_dotdot_attribute_store/zap-generated/include/dotdot_attributes.uam @@ -863,3 +863,24 @@ def DOTDOT_ATTRIBUTE_ID_PROTOCOL_CONTROLLER_NETWORK_MANAGEMENT_NETWORK_MANAGEMEN // This represents the attributes in the DotDot Descriptor cluster def DOTDOT_ATTRIBUTE_ID_DESCRIPTOR_DEVICE_TYPE_LIST 0xfd130000 +// This represents the attributes in the DotDot UnifyHumidityControl cluster +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE 0xfda00001 +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE 0xfda00002 +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE 0xfda00003 +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS 0xfda00004 +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN 0xfda00005 +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX 0xfda00006 +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT 0xfda00007 +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE 0xfda00008 +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION 0xfda00009 +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN 0xfda0000a +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX 0xfda0000b +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT 0xfda0000c +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE 0xfda0000d +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION 0xfda0000e +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN 0xfda0000f +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX 0xfda00010 +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT 0xfda00011 +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE 0xfda00012 +def DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION 0xfda00013 + diff --git a/components/unify_dotdot_attribute_store/zap-generated/include/dotdot_attributes_camel_case.uam b/components/unify_dotdot_attribute_store/zap-generated/include/dotdot_attributes_camel_case.uam index c4ef2c208..462948a86 100644 --- a/components/unify_dotdot_attribute_store/zap-generated/include/dotdot_attributes_camel_case.uam +++ b/components/unify_dotdot_attribute_store/zap-generated/include/dotdot_attributes_camel_case.uam @@ -863,3 +863,24 @@ def zb_NetworkManagementState 0xfd120001 // This represents short CamelCase labels the attributes in the DotDot Descriptor cluster def zb_DeviceTypeList 0xfd130000 +// This represents short CamelCase labels the attributes in the DotDot UnifyHumidityControl cluster +def zb_ReportingMode 0xfda00001 +def zb_SupportedReportingMode 0xfda00002 +def zb_CurrentState 0xfda00003 +def zb_SupportedSetPoints 0xfda00004 +def zb_HumidifierSetpointMin 0xfda00005 +def zb_HumidifierSetpointMax 0xfda00006 +def zb_HumidifierSetpoint 0xfda00007 +def zb_HumidifierSetpointScale 0xfda00008 +def zb_HumidifierSetpointPrecision 0xfda00009 +def zb_DehumidifierSetpointMin 0xfda0000a +def zb_DehumidifierSetpointMax 0xfda0000b +def zb_DehumidifierSetpoint 0xfda0000c +def zb_DehumidifierSetpointScale 0xfda0000d +def zb_DehumidifierSetpointPrecision 0xfda0000e +def zb_AutoSetpointMin 0xfda0000f +def zb_AutoSetpointMax 0xfda00010 +def zb_AutoSetpoint 0xfda00011 +def zb_AutoSetpointScale 0xfda00012 +def zb_AutoSetpointPrecision 0xfda00013 + diff --git a/components/unify_dotdot_attribute_store/zap-generated/include/unify_dotdot_attribute_store_helpers.h b/components/unify_dotdot_attribute_store/zap-generated/include/unify_dotdot_attribute_store_helpers.h index 16d75f051..17ec9f5fd 100644 --- a/components/unify_dotdot_attribute_store/zap-generated/include/unify_dotdot_attribute_store_helpers.h +++ b/components/unify_dotdot_attribute_store/zap-generated/include/unify_dotdot_attribute_store_helpers.h @@ -77649,6 +77649,2048 @@ bool dotdot_is_any_descriptor_writable_attribute_supported( const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); +//////////////////////////////////////////////////////////////////////////////// +// Start of cluster UnifyHumidityControl +//////////////////////////////////////////////////////////////////////////////// +// UnifyHumidityControl ReportingMode +/** + * @brief Verifies if the DotDot UnifyHumidityControl - ReportingMode is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if ReportingMode is supported + * @returns false if ReportingMode is not supported + */ +bool dotdot_is_supported_unify_humidity_control_reporting_mode ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - ReportingMode attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns ReportingMode attribute + */ +ModeType dotdot_get_unify_humidity_control_reporting_mode( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - ReportingMode attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_reporting_mode new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_reporting_mode( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + ModeType new_reporting_mode + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - ReportingMode + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_reporting_mode_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - ReportingMode attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_reporting_mode_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - ReportingMode attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_reporting_mode_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - ReportingMode attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_reporting_mode_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - ReportingMode attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_reporting_mode( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl SupportedReportingMode +/** + * @brief Verifies if the DotDot UnifyHumidityControl - SupportedReportingMode is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if SupportedReportingMode is supported + * @returns false if SupportedReportingMode is not supported + */ +bool dotdot_is_supported_unify_humidity_control_supported_reporting_mode ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - SupportedReportingMode attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns SupportedReportingMode attribute + */ +uint8_t dotdot_get_unify_humidity_control_supported_reporting_mode( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - SupportedReportingMode attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_supported_reporting_mode new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_supported_reporting_mode( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + uint8_t new_supported_reporting_mode + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - SupportedReportingMode + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_supported_reporting_mode_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - SupportedReportingMode attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_supported_reporting_mode_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - SupportedReportingMode attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_supported_reporting_mode_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - SupportedReportingMode attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_supported_reporting_mode_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - SupportedReportingMode attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_supported_reporting_mode( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl CurrentState +/** + * @brief Verifies if the DotDot UnifyHumidityControl - CurrentState is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if CurrentState is supported + * @returns false if CurrentState is not supported + */ +bool dotdot_is_supported_unify_humidity_control_current_state ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - CurrentState attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns CurrentState attribute + */ +uint8_t dotdot_get_unify_humidity_control_current_state( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - CurrentState attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_current_state new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_current_state( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + uint8_t new_current_state + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - CurrentState + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_current_state_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - CurrentState attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_current_state_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - CurrentState attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_current_state_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - CurrentState attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_current_state_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - CurrentState attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_current_state( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl SupportedSetPoints +/** + * @brief Verifies if the DotDot UnifyHumidityControl - SupportedSetPoints is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if SupportedSetPoints is supported + * @returns false if SupportedSetPoints is not supported + */ +bool dotdot_is_supported_unify_humidity_control_supported_set_points ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - SupportedSetPoints attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns SupportedSetPoints attribute + */ +uint8_t dotdot_get_unify_humidity_control_supported_set_points( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - SupportedSetPoints attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_supported_set_points new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_supported_set_points( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + uint8_t new_supported_set_points + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - SupportedSetPoints + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_supported_set_points_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - SupportedSetPoints attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_supported_set_points_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - SupportedSetPoints attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_supported_set_points_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - SupportedSetPoints attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_supported_set_points_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - SupportedSetPoints attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_supported_set_points( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl HumidifierSetpointMin +/** + * @brief Verifies if the DotDot UnifyHumidityControl - HumidifierSetpointMin is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if HumidifierSetpointMin is supported + * @returns false if HumidifierSetpointMin is not supported + */ +bool dotdot_is_supported_unify_humidity_control_humidifier_setpoint_min ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - HumidifierSetpointMin attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns HumidifierSetpointMin attribute + */ +int32_t dotdot_get_unify_humidity_control_humidifier_setpoint_min( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - HumidifierSetpointMin attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_humidifier_setpoint_min new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_humidifier_setpoint_min( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_humidifier_setpoint_min + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - HumidifierSetpointMin + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_min_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - HumidifierSetpointMin attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_min_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - HumidifierSetpointMin attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_humidifier_setpoint_min_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - HumidifierSetpointMin attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_humidifier_setpoint_min_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - HumidifierSetpointMin attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_humidifier_setpoint_min( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl HumidifierSetpointMax +/** + * @brief Verifies if the DotDot UnifyHumidityControl - HumidifierSetpointMax is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if HumidifierSetpointMax is supported + * @returns false if HumidifierSetpointMax is not supported + */ +bool dotdot_is_supported_unify_humidity_control_humidifier_setpoint_max ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - HumidifierSetpointMax attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns HumidifierSetpointMax attribute + */ +int32_t dotdot_get_unify_humidity_control_humidifier_setpoint_max( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - HumidifierSetpointMax attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_humidifier_setpoint_max new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_humidifier_setpoint_max( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_humidifier_setpoint_max + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - HumidifierSetpointMax + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_max_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - HumidifierSetpointMax attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_max_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - HumidifierSetpointMax attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_humidifier_setpoint_max_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - HumidifierSetpointMax attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_humidifier_setpoint_max_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - HumidifierSetpointMax attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_humidifier_setpoint_max( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl HumidifierSetpoint +/** + * @brief Verifies if the DotDot UnifyHumidityControl - HumidifierSetpoint is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if HumidifierSetpoint is supported + * @returns false if HumidifierSetpoint is not supported + */ +bool dotdot_is_supported_unify_humidity_control_humidifier_setpoint ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - HumidifierSetpoint attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns HumidifierSetpoint attribute + */ +int32_t dotdot_get_unify_humidity_control_humidifier_setpoint( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - HumidifierSetpoint attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_humidifier_setpoint new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_humidifier_setpoint( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_humidifier_setpoint + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - HumidifierSetpoint + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - HumidifierSetpoint attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - HumidifierSetpoint attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_humidifier_setpoint_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - HumidifierSetpoint attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_humidifier_setpoint_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - HumidifierSetpoint attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_humidifier_setpoint( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl HumidifierSetpointScale +/** + * @brief Verifies if the DotDot UnifyHumidityControl - HumidifierSetpointScale is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if HumidifierSetpointScale is supported + * @returns false if HumidifierSetpointScale is not supported + */ +bool dotdot_is_supported_unify_humidity_control_humidifier_setpoint_scale ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - HumidifierSetpointScale attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns HumidifierSetpointScale attribute + */ +ScaleType dotdot_get_unify_humidity_control_humidifier_setpoint_scale( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - HumidifierSetpointScale attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_humidifier_setpoint_scale new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_humidifier_setpoint_scale( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + ScaleType new_humidifier_setpoint_scale + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - HumidifierSetpointScale + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_scale_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - HumidifierSetpointScale attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_scale_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - HumidifierSetpointScale attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_humidifier_setpoint_scale_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - HumidifierSetpointScale attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_humidifier_setpoint_scale_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - HumidifierSetpointScale attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_humidifier_setpoint_scale( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl HumidifierSetpointPrecision +/** + * @brief Verifies if the DotDot UnifyHumidityControl - HumidifierSetpointPrecision is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if HumidifierSetpointPrecision is supported + * @returns false if HumidifierSetpointPrecision is not supported + */ +bool dotdot_is_supported_unify_humidity_control_humidifier_setpoint_precision ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - HumidifierSetpointPrecision attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns HumidifierSetpointPrecision attribute + */ +uint8_t dotdot_get_unify_humidity_control_humidifier_setpoint_precision( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - HumidifierSetpointPrecision attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_humidifier_setpoint_precision new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_humidifier_setpoint_precision( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + uint8_t new_humidifier_setpoint_precision + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - HumidifierSetpointPrecision + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_precision_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - HumidifierSetpointPrecision attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_precision_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - HumidifierSetpointPrecision attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_humidifier_setpoint_precision_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - HumidifierSetpointPrecision attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_humidifier_setpoint_precision_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - HumidifierSetpointPrecision attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_humidifier_setpoint_precision( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl DehumidifierSetpointMin +/** + * @brief Verifies if the DotDot UnifyHumidityControl - DehumidifierSetpointMin is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if DehumidifierSetpointMin is supported + * @returns false if DehumidifierSetpointMin is not supported + */ +bool dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint_min ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - DehumidifierSetpointMin attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns DehumidifierSetpointMin attribute + */ +int32_t dotdot_get_unify_humidity_control_dehumidifier_setpoint_min( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - DehumidifierSetpointMin attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_dehumidifier_setpoint_min new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_dehumidifier_setpoint_min( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_dehumidifier_setpoint_min + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - DehumidifierSetpointMin + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_min_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - DehumidifierSetpointMin attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_min_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - DehumidifierSetpointMin attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_dehumidifier_setpoint_min_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - DehumidifierSetpointMin attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_dehumidifier_setpoint_min_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - DehumidifierSetpointMin attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_dehumidifier_setpoint_min( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl DehumidifierSetpointMax +/** + * @brief Verifies if the DotDot UnifyHumidityControl - DehumidifierSetpointMax is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if DehumidifierSetpointMax is supported + * @returns false if DehumidifierSetpointMax is not supported + */ +bool dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint_max ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - DehumidifierSetpointMax attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns DehumidifierSetpointMax attribute + */ +int32_t dotdot_get_unify_humidity_control_dehumidifier_setpoint_max( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - DehumidifierSetpointMax attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_dehumidifier_setpoint_max new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_dehumidifier_setpoint_max( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_dehumidifier_setpoint_max + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - DehumidifierSetpointMax + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_max_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - DehumidifierSetpointMax attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_max_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - DehumidifierSetpointMax attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_dehumidifier_setpoint_max_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - DehumidifierSetpointMax attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_dehumidifier_setpoint_max_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - DehumidifierSetpointMax attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_dehumidifier_setpoint_max( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl DehumidifierSetpoint +/** + * @brief Verifies if the DotDot UnifyHumidityControl - DehumidifierSetpoint is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if DehumidifierSetpoint is supported + * @returns false if DehumidifierSetpoint is not supported + */ +bool dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - DehumidifierSetpoint attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns DehumidifierSetpoint attribute + */ +int32_t dotdot_get_unify_humidity_control_dehumidifier_setpoint( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - DehumidifierSetpoint attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_dehumidifier_setpoint new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_dehumidifier_setpoint( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_dehumidifier_setpoint + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - DehumidifierSetpoint + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - DehumidifierSetpoint attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - DehumidifierSetpoint attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_dehumidifier_setpoint_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - DehumidifierSetpoint attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_dehumidifier_setpoint_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - DehumidifierSetpoint attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_dehumidifier_setpoint( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl DehumidifierSetpointScale +/** + * @brief Verifies if the DotDot UnifyHumidityControl - DehumidifierSetpointScale is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if DehumidifierSetpointScale is supported + * @returns false if DehumidifierSetpointScale is not supported + */ +bool dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint_scale ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - DehumidifierSetpointScale attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns DehumidifierSetpointScale attribute + */ +ScaleType dotdot_get_unify_humidity_control_dehumidifier_setpoint_scale( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - DehumidifierSetpointScale attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_dehumidifier_setpoint_scale new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_dehumidifier_setpoint_scale( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + ScaleType new_dehumidifier_setpoint_scale + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - DehumidifierSetpointScale + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_scale_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - DehumidifierSetpointScale attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_scale_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - DehumidifierSetpointScale attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_dehumidifier_setpoint_scale_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - DehumidifierSetpointScale attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_dehumidifier_setpoint_scale_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - DehumidifierSetpointScale attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_dehumidifier_setpoint_scale( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl DehumidifierSetpointPrecision +/** + * @brief Verifies if the DotDot UnifyHumidityControl - DehumidifierSetpointPrecision is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if DehumidifierSetpointPrecision is supported + * @returns false if DehumidifierSetpointPrecision is not supported + */ +bool dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint_precision ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - DehumidifierSetpointPrecision attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns DehumidifierSetpointPrecision attribute + */ +uint8_t dotdot_get_unify_humidity_control_dehumidifier_setpoint_precision( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - DehumidifierSetpointPrecision attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_dehumidifier_setpoint_precision new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_dehumidifier_setpoint_precision( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + uint8_t new_dehumidifier_setpoint_precision + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - DehumidifierSetpointPrecision + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_precision_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - DehumidifierSetpointPrecision attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_precision_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - DehumidifierSetpointPrecision attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_dehumidifier_setpoint_precision_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - DehumidifierSetpointPrecision attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_dehumidifier_setpoint_precision_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - DehumidifierSetpointPrecision attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_dehumidifier_setpoint_precision( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl AutoSetpointMin +/** + * @brief Verifies if the DotDot UnifyHumidityControl - AutoSetpointMin is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if AutoSetpointMin is supported + * @returns false if AutoSetpointMin is not supported + */ +bool dotdot_is_supported_unify_humidity_control_auto_setpoint_min ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - AutoSetpointMin attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns AutoSetpointMin attribute + */ +int32_t dotdot_get_unify_humidity_control_auto_setpoint_min( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - AutoSetpointMin attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_auto_setpoint_min new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_auto_setpoint_min( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_auto_setpoint_min + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - AutoSetpointMin + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_auto_setpoint_min_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - AutoSetpointMin attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_auto_setpoint_min_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - AutoSetpointMin attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_auto_setpoint_min_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - AutoSetpointMin attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_auto_setpoint_min_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - AutoSetpointMin attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_auto_setpoint_min( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl AutoSetpointMax +/** + * @brief Verifies if the DotDot UnifyHumidityControl - AutoSetpointMax is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if AutoSetpointMax is supported + * @returns false if AutoSetpointMax is not supported + */ +bool dotdot_is_supported_unify_humidity_control_auto_setpoint_max ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - AutoSetpointMax attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns AutoSetpointMax attribute + */ +int32_t dotdot_get_unify_humidity_control_auto_setpoint_max( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - AutoSetpointMax attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_auto_setpoint_max new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_auto_setpoint_max( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_auto_setpoint_max + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - AutoSetpointMax + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_auto_setpoint_max_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - AutoSetpointMax attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_auto_setpoint_max_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - AutoSetpointMax attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_auto_setpoint_max_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - AutoSetpointMax attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_auto_setpoint_max_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - AutoSetpointMax attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_auto_setpoint_max( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl AutoSetpoint +/** + * @brief Verifies if the DotDot UnifyHumidityControl - AutoSetpoint is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if AutoSetpoint is supported + * @returns false if AutoSetpoint is not supported + */ +bool dotdot_is_supported_unify_humidity_control_auto_setpoint ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - AutoSetpoint attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns AutoSetpoint attribute + */ +int32_t dotdot_get_unify_humidity_control_auto_setpoint( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - AutoSetpoint attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_auto_setpoint new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_auto_setpoint( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_auto_setpoint + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - AutoSetpoint + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_auto_setpoint_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - AutoSetpoint attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_auto_setpoint_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - AutoSetpoint attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_auto_setpoint_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - AutoSetpoint attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_auto_setpoint_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - AutoSetpoint attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_auto_setpoint( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl AutoSetpointScale +/** + * @brief Verifies if the DotDot UnifyHumidityControl - AutoSetpointScale is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if AutoSetpointScale is supported + * @returns false if AutoSetpointScale is not supported + */ +bool dotdot_is_supported_unify_humidity_control_auto_setpoint_scale ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - AutoSetpointScale attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns AutoSetpointScale attribute + */ +ScaleType dotdot_get_unify_humidity_control_auto_setpoint_scale( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - AutoSetpointScale attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_auto_setpoint_scale new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_auto_setpoint_scale( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + ScaleType new_auto_setpoint_scale + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - AutoSetpointScale + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_auto_setpoint_scale_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - AutoSetpointScale attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_auto_setpoint_scale_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - AutoSetpointScale attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_auto_setpoint_scale_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - AutoSetpointScale attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_auto_setpoint_scale_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - AutoSetpointScale attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_auto_setpoint_scale( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); +// UnifyHumidityControl AutoSetpointPrecision +/** + * @brief Verifies if the DotDot UnifyHumidityControl - AutoSetpointPrecision is supported + * under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * + * @returns true if AutoSetpointPrecision is supported + * @returns false if AutoSetpointPrecision is not supported + */ +bool dotdot_is_supported_unify_humidity_control_auto_setpoint_precision ( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Gets the DotDot UnifyHumidityControl - AutoSetpointPrecision attribute value under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to get, + * see \ref attribute_store_get_node_attribute_value + * + * + * @returns AutoSetpointPrecision attribute + */ +uint8_t dotdot_get_unify_humidity_control_auto_setpoint_precision( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state); + +/** + * @brief Set the DotDot UnifyHumidityControl - AutoSetpointPrecision attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @param value_state value state to write for the node, + * see \ref attribute_store_set_node_attribute_value + * + * @param new_auto_setpoint_precision new value to set + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_set_unify_humidity_control_auto_setpoint_precision( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + uint8_t new_auto_setpoint_precision + ); + +/** + * @brief Undefines the Reported value of the the DotDot UnifyHumidityControl - AutoSetpointPrecision + * attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_auto_setpoint_precision_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Undefines the Desired value of the DotDot + * UnifyHumidityControl - AutoSetpointPrecision attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_unify_humidity_control_auto_setpoint_precision_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the reported value is defined for the DotDot + * UnifyHumidityControl - AutoSetpointPrecision attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_auto_setpoint_precision_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if the desired value is defined for the DotDot + * UnifyHumidityControl - AutoSetpointPrecision attribute under a UNID/EndpointID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if defined, false is undefined or non-existent + */ +bool dotdot_unify_humidity_control_auto_setpoint_precision_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Creates a DotDot UnifyHumidityControl - AutoSetpointPrecision attribute under a UNID/EndpoinID + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns sl_status_t SL_STATUS_OK on success + */ +sl_status_t dotdot_create_unify_humidity_control_auto_setpoint_precision( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if a UNID/Endpoint supports any attribute for the UnifyHumidityControl + * Cluster + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if at least 1 attribute in the Attribute Store, false otherwise + */ +bool dotdot_is_any_unify_humidity_control_attribute_supported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + +/** + * @brief Checks if a UNID/Endpoint supports any writable attribute for the + * UnifyHumidityControl Cluster + * + * @param unid Node's UNID + * @param endpoint_id Endpoint ID + * @returns true if at least 1 writable attribute in the Attribute Store, false otherwise + */ +bool dotdot_is_any_unify_humidity_control_writable_attribute_supported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id); + #ifdef __cplusplus } #endif // __cplusplus diff --git a/components/unify_dotdot_attribute_store/zap-generated/include/unify_dotdot_defined_attribute_types.h b/components/unify_dotdot_attribute_store/zap-generated/include/unify_dotdot_defined_attribute_types.h index 0118d5ba2..05d71d3bd 100644 --- a/components/unify_dotdot_attribute_store/zap-generated/include/unify_dotdot_defined_attribute_types.h +++ b/components/unify_dotdot_attribute_store/zap-generated/include/unify_dotdot_defined_attribute_types.h @@ -794,6 +794,26 @@ DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_AOX_POSITION_ESTIMATION_POSITION , 0xfd1100 DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_PROTOCOL_CONTROLLER_NETWORK_MANAGEMENT_NETWORK_MANAGEMENT_STATE , 0xfd120001) // Attribute Defines for Descriptor DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_DESCRIPTOR_DEVICE_TYPE_LIST , 0xfd130000) +// Attribute Defines for UnifyHumidityControl +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE , 0xfda00001) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE , 0xfda00002) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE , 0xfda00003) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS , 0xfda00004) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN , 0xfda00005) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX , 0xfda00006) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT , 0xfda00007) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE , 0xfda00008) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION , 0xfda00009) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN , 0xfda0000a) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX , 0xfda0000b) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT , 0xfda0000c) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE , 0xfda0000d) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION , 0xfda0000e) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN , 0xfda0000f) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX , 0xfda00010) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT , 0xfda00011) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE , 0xfda00012) +DEFINE_ATTRIBUTE(DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION , 0xfda00013) // Additional manually defined types: diff --git a/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_attribute_publisher.cpp b/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_attribute_publisher.cpp index 2aba63453..763a0d926 100644 --- a/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_attribute_publisher.cpp +++ b/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_attribute_publisher.cpp @@ -25633,6 +25633,617 @@ static void descriptor_cluster_cluster_revision_callback( } +/** + * @brief Publishes the desired value of an updated attribute store node for + * the UnifyHumidityControl cluster. + * @param updated_node Updated attribute store node + * @param change Type of change applied + */ +static void unify_humidity_control_cluster_publish_desired_value_callback( + attribute_store_node_t updated_node, attribute_store_change_t change) +{ + // clang-format on + if (false == is_publish_desired_attribute_values_to_mqtt_enabled()) { + return; + } + if (change == ATTRIBUTE_DELETED || change == ATTRIBUTE_CREATED) { + return; + } + // Scene exception: check that the attribute is not under the Scene Table extension, which is a config and not the node's state. + if (ATTRIBUTE_STORE_INVALID_NODE + != attribute_store_get_first_parent_with_type( + updated_node, + DOTDOT_ATTRIBUTE_ID_SCENES_SCENE_TABLE)) { + return; + } + + // Get the UNID and EndPoint, and prepare the basic topic + char unid[MAXIMUM_UNID_SIZE] = {}; + // clang-format off + // clang-format on + dotdot_endpoint_id_t endpoint_id = 0; + if (SL_STATUS_OK + != unify_dotdot_attributes_get_unid_endpoint()(updated_node, + unid, + &endpoint_id)) { + return; + } + // clang-format off + // clang-format on + + std::string base_topic = "ucl/by-unid/" + std::string(unid); + // clang-format off + base_topic += "/ep" + std::to_string(endpoint_id); + // clang-format on + + attribute_store_type_t type = attribute_store_get_node_type(updated_node); + if (type == ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE) { + sl_log_debug(LOG_TAG, + "Warning: Invalid type for Attribute ID %d, " + "this should not happen.", + updated_node); + return; + } + + // If the value got updated but both Reported and Desired undefined, we skip publication + if (false == attribute_store_is_reported_defined(updated_node) + && false == attribute_store_is_desired_defined(updated_node)) { + sl_log_debug(LOG_TAG, + "Reported/Desired values are undefined. " + "Skipping publication"); + return; + } + + // clang-format off + try { + attribute_store::attribute attr(updated_node); + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE) { + uic_mqtt_dotdot_unify_humidity_control_reporting_mode_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE) { + uic_mqtt_dotdot_unify_humidity_control_supported_reporting_mode_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE) { + uic_mqtt_dotdot_unify_humidity_control_current_state_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS) { + uic_mqtt_dotdot_unify_humidity_control_supported_set_points_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN) { + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_min_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX) { + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_max_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT) { + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE) { + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_scale_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION) { + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_precision_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN) { + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_min_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX) { + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_max_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT) { + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE) { + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_scale_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION) { + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_precision_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN) { + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_min_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX) { + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_max_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT) { + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE) { + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_scale_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION) { + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_precision_publish( + base_topic.c_str(), + static_cast(attr.desired_or_reported()), + UCL_MQTT_PUBLISH_TYPE_DESIRED); + return; + } + } catch (std::exception &ex) { + sl_log_warning(LOG_TAG, "Failed to publish the Desired attribute value: %s", ex.what()); + } +} + +/** + * @brief Publishes the reported value of an updated attribute store node for + * the UnifyHumidityControl cluster. + * @param updated_node Updated attribute store node + * @param change Type of change applied + */ +static void unify_humidity_control_cluster_publish_reported_value_callback( + attribute_store_node_t updated_node, attribute_store_change_t change) +{ + // clang-format on + if (false == is_publish_reported_attribute_values_to_mqtt_enabled()) { + return; + } + if (change == ATTRIBUTE_CREATED) { + return; + } + // Scene exception: check that the attribute is not under the Scene Table extension, which is a config and not the node's state. + if (ATTRIBUTE_STORE_INVALID_NODE + != attribute_store_get_first_parent_with_type( + updated_node, + DOTDOT_ATTRIBUTE_ID_SCENES_SCENE_TABLE)) { + return; + } + + // Get the UNID and EndPoint, and prepare the basic topic + char unid[MAXIMUM_UNID_SIZE] = {}; + // clang-format off + // clang-format on + dotdot_endpoint_id_t endpoint_id = 0; + if (SL_STATUS_OK + != unify_dotdot_attributes_get_unid_endpoint()(updated_node, + unid, + &endpoint_id)) { + return; + } + // clang-format off + // clang-format on + + std::string base_topic = "ucl/by-unid/" + std::string(unid); + // clang-format off + base_topic += "/ep" + std::to_string(endpoint_id); + // clang-format on + + attribute_store_type_t type = attribute_store_get_node_type(updated_node); + if (type == ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE) { + sl_log_debug(LOG_TAG, + "Warning: Invalid type for Attribute ID %d, " + "this should not happen.", + updated_node); + return; + } + + // Deletion case: + if (change == ATTRIBUTE_DELETED) { + // clang-format off + switch(type) { + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::ReportingMode under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_reporting_mode_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::SupportedReportingMode under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_supported_reporting_mode_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::CurrentState under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_current_state_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::SupportedSetPoints under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_supported_set_points_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::HumidifierSetpointMin under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_min_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::HumidifierSetpointMax under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_max_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::HumidifierSetpoint under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::HumidifierSetpointScale under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_scale_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::HumidifierSetpointPrecision under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_precision_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::DehumidifierSetpointMin under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_min_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::DehumidifierSetpointMax under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_max_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::DehumidifierSetpoint under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::DehumidifierSetpointScale under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_scale_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::DehumidifierSetpointPrecision under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_precision_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::AutoSetpointMin under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_min_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::AutoSetpointMax under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_max_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::AutoSetpoint under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::AutoSetpointScale under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_scale_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + case DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION: + // clang-format on + sl_log_debug(LOG_TAG, + "Unretaining UnifyHumidityControl::AutoSetpointPrecision under topic %s", + base_topic.c_str()); + // clang-format off + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_precision_unretain(base_topic.c_str(), UCL_MQTT_PUBLISH_TYPE_ALL); + break; + default: + break; + } + // clang-format on + return; + } + + // If the value got updated but undefined, we skip publication + if (false == attribute_store_is_reported_defined(updated_node)) { + sl_log_debug(LOG_TAG, "Reported value is undefined. Skipping publication"); + return; + } + + // Else we assume update case: + // clang-format off + try { + attribute_store::attribute attr(updated_node); + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE) { + uic_mqtt_dotdot_unify_humidity_control_reporting_mode_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE) { + uic_mqtt_dotdot_unify_humidity_control_supported_reporting_mode_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE) { + uic_mqtt_dotdot_unify_humidity_control_current_state_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS) { + uic_mqtt_dotdot_unify_humidity_control_supported_set_points_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN) { + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_min_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX) { + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_max_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT) { + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE) { + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_scale_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION) { + uic_mqtt_dotdot_unify_humidity_control_humidifier_setpoint_precision_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN) { + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_min_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX) { + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_max_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT) { + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE) { + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_scale_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION) { + uic_mqtt_dotdot_unify_humidity_control_dehumidifier_setpoint_precision_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN) { + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_min_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX) { + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_max_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT) { + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE) { + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_scale_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + if (type == DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION) { + uic_mqtt_dotdot_unify_humidity_control_auto_setpoint_precision_publish( + base_topic.c_str(), + static_cast(attr.reported()), + (attr.desired_exists() && !attribute_store_is_value_matched(updated_node)) ? UCL_MQTT_PUBLISH_TYPE_REPORTED : UCL_MQTT_PUBLISH_TYPE_ALL); + return; + } + } catch (std::exception &ex) { + sl_log_warning(LOG_TAG, "Failed to publish the Reported attribute value: %s", ex.what()); + } +} + +static void unify_humidity_control_cluster_cluster_revision_callback( + attribute_store_node_t updated_node, attribute_store_change_t change) +{ + // clang-format on + if (false == is_publish_reported_attribute_values_to_mqtt_enabled()) { + return; + } + + // Get the UNID and EndPoint, and prepare the basic topic + char unid[MAXIMUM_UNID_SIZE] = {}; + dotdot_endpoint_id_t endpoint_id = 0; + // clang-format off + // clang-format on + if (SL_STATUS_OK + != unify_dotdot_attributes_get_unid_endpoint()(updated_node, + unid, + &endpoint_id)) { + return; + } + // clang-format off + // clang-format on + + std::string base_topic = "ucl/by-unid/" + std::string(unid); + // clang-format off + base_topic += "/ep" + std::to_string(endpoint_id); + + if ((change == ATTRIBUTE_CREATED) || (change == ATTRIBUTE_UPDATED)) { + // On attribute creation, make sure to publish the attribute revision for the first time + std::string cluster_revision_topic = base_topic + "/UnifyHumidityControl/Attributes/ClusterRevision"; + if (uic_mqtt_count_topics(cluster_revision_topic.c_str()) == 0) { + uic_mqtt_dotdot_unify_humidity_control_publish_cluster_revision(base_topic.c_str(), 1); + } + } + + if (change == ATTRIBUTE_DELETED) { + // Check if we just erased the last attribute under a cluster, if yes, unretain + // the Cluster revision too. + if (false == dotdot_is_any_unify_humidity_control_attribute_supported(unid, endpoint_id)) { + base_topic += "/UnifyHumidityControl"; + sl_log_debug(LOG_TAG, "No more attributes supported for UnifyHumidityControl cluster for UNID %s Endpoint %d. Unretaining leftover topics at %s",unid, endpoint_id, base_topic.c_str()); + uic_mqtt_unretain(base_topic.c_str()); + } + } +} + + // Initialization of the component. sl_status_t unify_dotdot_attribute_store_attribute_publisher_init() @@ -35675,6 +36286,272 @@ sl_status_t unify_dotdot_attribute_store_attribute_publisher_init() attribute_store_register_callback_by_type( descriptor_cluster_cluster_revision_callback, DOTDOT_ATTRIBUTE_ID_DESCRIPTOR_DEVICE_TYPE_LIST); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE); + //Desired attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_desired_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION, + DESIRED_ATTRIBUTE); + //Reported attribute state + attribute_store_register_callback_by_type_and_state( + unify_humidity_control_cluster_publish_reported_value_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION, + REPORTED_ATTRIBUTE); + //registering a callback when an attribute is created for publishing cluster revision + attribute_store_register_callback_by_type( + unify_humidity_control_cluster_cluster_revision_callback, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION); return SL_STATUS_OK; } diff --git a/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_force_read_attributes_command_callbacks.c b/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_force_read_attributes_command_callbacks.c index 5d488fb5a..a9e76208f 100644 --- a/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_force_read_attributes_command_callbacks.c +++ b/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_force_read_attributes_command_callbacks.c @@ -4499,6 +4499,126 @@ static sl_status_t uic_mqtt_dotdot_descriptor_force_read_attributes_callback ( } return SL_STATUS_OK; } +//////////////////////////////////////////////////////////////////////////////// +// Start of cluster UnifyHumidityControl +//////////////////////////////////////////////////////////////////////////////// +static sl_status_t uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback ( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + uic_mqtt_dotdot_callback_call_type_t call_type, + uic_mqtt_dotdot_unify_humidity_control_updated_state_t attribute_list) { + + if (false == is_force_read_attributes_enabled()){ + return SL_STATUS_FAIL; + } + + if (call_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK) { + if (is_automatic_deduction_of_supported_commands_enabled()) { + return dotdot_is_any_unify_humidity_control_attribute_supported(unid, endpoint_id) ? + SL_STATUS_OK : SL_STATUS_FAIL; + } else { + return SL_STATUS_FAIL; + } + } + + // Go and undefine everything that needs to be read again: + if (true == attribute_list.reporting_mode) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_reporting_mode_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::ReportingMode under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.supported_reporting_mode) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_supported_reporting_mode_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::SupportedReportingMode under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.current_state) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_current_state_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::CurrentState under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.supported_set_points) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_supported_set_points_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::SupportedSetPoints under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.humidifier_setpoint_min) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_humidifier_setpoint_min_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::HumidifierSetpointMin under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.humidifier_setpoint_max) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_humidifier_setpoint_max_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::HumidifierSetpointMax under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.humidifier_setpoint) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_humidifier_setpoint_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::HumidifierSetpoint under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.humidifier_setpoint_scale) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_humidifier_setpoint_scale_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::HumidifierSetpointScale under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.humidifier_setpoint_precision) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_humidifier_setpoint_precision_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::HumidifierSetpointPrecision under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.dehumidifier_setpoint_min) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_dehumidifier_setpoint_min_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::DehumidifierSetpointMin under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.dehumidifier_setpoint_max) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_dehumidifier_setpoint_max_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::DehumidifierSetpointMax under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.dehumidifier_setpoint) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_dehumidifier_setpoint_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::DehumidifierSetpoint under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.dehumidifier_setpoint_scale) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_dehumidifier_setpoint_scale_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::DehumidifierSetpointScale under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.dehumidifier_setpoint_precision) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_dehumidifier_setpoint_precision_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::DehumidifierSetpointPrecision under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.auto_setpoint_min) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_auto_setpoint_min_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::AutoSetpointMin under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.auto_setpoint_max) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_auto_setpoint_max_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::AutoSetpointMax under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.auto_setpoint) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_auto_setpoint_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::AutoSetpoint under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.auto_setpoint_scale) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_auto_setpoint_scale_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::AutoSetpointScale under %s - Endpoint %d", unid, endpoint_id); + } + } + if (true == attribute_list.auto_setpoint_precision) { + if (SL_STATUS_OK == dotdot_unify_humidity_control_auto_setpoint_precision_undefine_reported(unid, endpoint_id)) { + sl_log_debug(LOG_TAG, "Undefined Reported value of UnifyHumidityControl::AutoSetpointPrecision under %s - Endpoint %d", unid, endpoint_id); + } + } + return SL_STATUS_OK; +} // clang-format on //////////////////////////////////////////////////////////////////////////////// @@ -4609,6 +4729,8 @@ sl_status_t uic_mqtt_dotdot_set_descriptor_force_read_attributes_callback(&uic_mqtt_dotdot_descriptor_force_read_attributes_callback); + uic_mqtt_dotdot_set_unify_humidity_control_force_read_attributes_callback(&uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback); + // clang-format on return SL_STATUS_OK; diff --git a/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_helpers.cpp b/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_helpers.cpp index e170bb45b..50d1f569c 100644 --- a/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_helpers.cpp +++ b/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_helpers.cpp @@ -83593,5 +83593,2193 @@ bool dotdot_is_any_descriptor_writable_attribute_supported( const dotdot_endpoint_id_t endpoint_id) { + return false; +} +//////////////////////////////////////////////////////////////////////////////// +// Start of cluster UnifyHumidityControl +//////////////////////////////////////////////////////////////////////////////// +bool dotdot_is_supported_unify_humidity_control_reporting_mode( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE); + return attribute_store_node_exists(node); +} + +ModeType dotdot_get_unify_humidity_control_reporting_mode( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE); + + ModeType result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_reporting_mode( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + ModeType new_reporting_mode + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_reporting_mode, + sizeof(ModeType)); + } + +sl_status_t dotdot_unify_humidity_control_reporting_mode_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_reporting_mode_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_reporting_mode_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_reporting_mode_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_reporting_mode( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_supported_reporting_mode( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE); + return attribute_store_node_exists(node); +} + +uint8_t dotdot_get_unify_humidity_control_supported_reporting_mode( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE); + + uint8_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_supported_reporting_mode( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + uint8_t new_supported_reporting_mode + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_supported_reporting_mode, + sizeof(uint8_t)); + } + +sl_status_t dotdot_unify_humidity_control_supported_reporting_mode_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_supported_reporting_mode_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_supported_reporting_mode_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_supported_reporting_mode_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_supported_reporting_mode( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_current_state( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE); + return attribute_store_node_exists(node); +} + +uint8_t dotdot_get_unify_humidity_control_current_state( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE); + + uint8_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_current_state( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + uint8_t new_current_state + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_current_state, + sizeof(uint8_t)); + } + +sl_status_t dotdot_unify_humidity_control_current_state_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_current_state_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_current_state_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_current_state_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_current_state( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_supported_set_points( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS); + return attribute_store_node_exists(node); +} + +uint8_t dotdot_get_unify_humidity_control_supported_set_points( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS); + + uint8_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_supported_set_points( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + uint8_t new_supported_set_points + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_supported_set_points, + sizeof(uint8_t)); + } + +sl_status_t dotdot_unify_humidity_control_supported_set_points_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_supported_set_points_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_supported_set_points_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_supported_set_points_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_supported_set_points( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_humidifier_setpoint_min( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN); + return attribute_store_node_exists(node); +} + +int32_t dotdot_get_unify_humidity_control_humidifier_setpoint_min( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN); + + int32_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_humidifier_setpoint_min( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_humidifier_setpoint_min + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_humidifier_setpoint_min, + sizeof(int32_t)); + } + +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_min_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_min_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_humidifier_setpoint_min_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_humidifier_setpoint_min_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_humidifier_setpoint_min( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_humidifier_setpoint_max( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX); + return attribute_store_node_exists(node); +} + +int32_t dotdot_get_unify_humidity_control_humidifier_setpoint_max( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX); + + int32_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_humidifier_setpoint_max( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_humidifier_setpoint_max + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_humidifier_setpoint_max, + sizeof(int32_t)); + } + +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_max_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_max_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_humidifier_setpoint_max_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_humidifier_setpoint_max_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_humidifier_setpoint_max( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_humidifier_setpoint( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT); + return attribute_store_node_exists(node); +} + +int32_t dotdot_get_unify_humidity_control_humidifier_setpoint( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT); + + int32_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_humidifier_setpoint( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_humidifier_setpoint + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_humidifier_setpoint, + sizeof(int32_t)); + } + +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_humidifier_setpoint_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_humidifier_setpoint_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_humidifier_setpoint( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_humidifier_setpoint_scale( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE); + return attribute_store_node_exists(node); +} + +ScaleType dotdot_get_unify_humidity_control_humidifier_setpoint_scale( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE); + + ScaleType result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_humidifier_setpoint_scale( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + ScaleType new_humidifier_setpoint_scale + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_humidifier_setpoint_scale, + sizeof(ScaleType)); + } + +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_scale_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_scale_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_humidifier_setpoint_scale_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_humidifier_setpoint_scale_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_humidifier_setpoint_scale( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_humidifier_setpoint_precision( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION); + return attribute_store_node_exists(node); +} + +uint8_t dotdot_get_unify_humidity_control_humidifier_setpoint_precision( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION); + + uint8_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_humidifier_setpoint_precision( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + uint8_t new_humidifier_setpoint_precision + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_humidifier_setpoint_precision, + sizeof(uint8_t)); + } + +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_precision_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_humidifier_setpoint_precision_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_humidifier_setpoint_precision_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_humidifier_setpoint_precision_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_humidifier_setpoint_precision( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint_min( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN); + return attribute_store_node_exists(node); +} + +int32_t dotdot_get_unify_humidity_control_dehumidifier_setpoint_min( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN); + + int32_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_dehumidifier_setpoint_min( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_dehumidifier_setpoint_min + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_dehumidifier_setpoint_min, + sizeof(int32_t)); + } + +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_min_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_min_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_dehumidifier_setpoint_min_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_dehumidifier_setpoint_min_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_dehumidifier_setpoint_min( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint_max( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX); + return attribute_store_node_exists(node); +} + +int32_t dotdot_get_unify_humidity_control_dehumidifier_setpoint_max( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX); + + int32_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_dehumidifier_setpoint_max( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_dehumidifier_setpoint_max + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_dehumidifier_setpoint_max, + sizeof(int32_t)); + } + +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_max_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_max_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_dehumidifier_setpoint_max_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_dehumidifier_setpoint_max_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_dehumidifier_setpoint_max( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT); + return attribute_store_node_exists(node); +} + +int32_t dotdot_get_unify_humidity_control_dehumidifier_setpoint( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT); + + int32_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_dehumidifier_setpoint( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_dehumidifier_setpoint + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_dehumidifier_setpoint, + sizeof(int32_t)); + } + +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_dehumidifier_setpoint_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_dehumidifier_setpoint_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_dehumidifier_setpoint( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint_scale( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE); + return attribute_store_node_exists(node); +} + +ScaleType dotdot_get_unify_humidity_control_dehumidifier_setpoint_scale( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE); + + ScaleType result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_dehumidifier_setpoint_scale( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + ScaleType new_dehumidifier_setpoint_scale + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_dehumidifier_setpoint_scale, + sizeof(ScaleType)); + } + +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_scale_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_scale_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_dehumidifier_setpoint_scale_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_dehumidifier_setpoint_scale_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_dehumidifier_setpoint_scale( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint_precision( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION); + return attribute_store_node_exists(node); +} + +uint8_t dotdot_get_unify_humidity_control_dehumidifier_setpoint_precision( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION); + + uint8_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_dehumidifier_setpoint_precision( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + uint8_t new_dehumidifier_setpoint_precision + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_dehumidifier_setpoint_precision, + sizeof(uint8_t)); + } + +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_precision_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_dehumidifier_setpoint_precision_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_dehumidifier_setpoint_precision_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_dehumidifier_setpoint_precision_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_dehumidifier_setpoint_precision( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_auto_setpoint_min( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN); + return attribute_store_node_exists(node); +} + +int32_t dotdot_get_unify_humidity_control_auto_setpoint_min( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN); + + int32_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_auto_setpoint_min( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_auto_setpoint_min + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_auto_setpoint_min, + sizeof(int32_t)); + } + +sl_status_t dotdot_unify_humidity_control_auto_setpoint_min_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_auto_setpoint_min_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_auto_setpoint_min_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_auto_setpoint_min_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_auto_setpoint_min( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_auto_setpoint_max( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX); + return attribute_store_node_exists(node); +} + +int32_t dotdot_get_unify_humidity_control_auto_setpoint_max( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX); + + int32_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_auto_setpoint_max( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_auto_setpoint_max + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_auto_setpoint_max, + sizeof(int32_t)); + } + +sl_status_t dotdot_unify_humidity_control_auto_setpoint_max_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_auto_setpoint_max_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_auto_setpoint_max_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_auto_setpoint_max_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_auto_setpoint_max( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_auto_setpoint( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT); + return attribute_store_node_exists(node); +} + +int32_t dotdot_get_unify_humidity_control_auto_setpoint( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT); + + int32_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_auto_setpoint( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + int32_t new_auto_setpoint + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_auto_setpoint, + sizeof(int32_t)); + } + +sl_status_t dotdot_unify_humidity_control_auto_setpoint_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_auto_setpoint_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_auto_setpoint_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_auto_setpoint_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_auto_setpoint( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_auto_setpoint_scale( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE); + return attribute_store_node_exists(node); +} + +ScaleType dotdot_get_unify_humidity_control_auto_setpoint_scale( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE); + + ScaleType result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_auto_setpoint_scale( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + ScaleType new_auto_setpoint_scale + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_auto_setpoint_scale, + sizeof(ScaleType)); + } + +sl_status_t dotdot_unify_humidity_control_auto_setpoint_scale_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_auto_setpoint_scale_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_auto_setpoint_scale_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_auto_setpoint_scale_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_auto_setpoint_scale( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} +bool dotdot_is_supported_unify_humidity_control_auto_setpoint_precision( + const dotdot_unid_t unid, const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION); + return attribute_store_node_exists(node); +} + +uint8_t dotdot_get_unify_humidity_control_auto_setpoint_precision( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION); + + uint8_t result = {}; + attribute_store_read_value(node, + value_state, + (uint8_t *)&result, + sizeof(result)); + return result; +} + +sl_status_t dotdot_set_unify_humidity_control_auto_setpoint_precision( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + attribute_store_node_value_state_t value_state, + uint8_t new_auto_setpoint_precision + ) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION); + + return attribute_store_set_node_attribute_value(node, + value_state, + (uint8_t *)&new_auto_setpoint_precision, + sizeof(uint8_t)); + } + +sl_status_t dotdot_unify_humidity_control_auto_setpoint_precision_undefine_reported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION); + attribute_store_undefine_reported(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t dotdot_unify_humidity_control_auto_setpoint_precision_undefine_desired( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION); + attribute_store_undefine_desired(node); + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + + +bool dotdot_unify_humidity_control_auto_setpoint_precision_is_reported_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION); + return attribute_store_is_reported_defined(node); +} + +bool dotdot_unify_humidity_control_auto_setpoint_precision_is_desired_defined( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) +{ + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node + = attribute_store_get_first_child_by_type( + endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION); + return attribute_store_is_desired_defined(node); +} + +sl_status_t dotdot_create_unify_humidity_control_auto_setpoint_precision( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + attribute_store_node_t endpoint_node = unify_dotdot_attributes_get_endpoint_node()(unid, endpoint_id); + attribute_store_node_t node = + attribute_store_create_child_if_missing(endpoint_node, + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION); + + return (node != ATTRIBUTE_STORE_INVALID_NODE) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +bool dotdot_is_any_unify_humidity_control_attribute_supported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + if (true == dotdot_is_supported_unify_humidity_control_reporting_mode(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_supported_reporting_mode(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_current_state(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_supported_set_points(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_humidifier_setpoint_min(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_humidifier_setpoint_max(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_humidifier_setpoint(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_humidifier_setpoint_scale(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_humidifier_setpoint_precision(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint_min(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint_max(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint_scale(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_dehumidifier_setpoint_precision(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_auto_setpoint_min(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_auto_setpoint_max(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_auto_setpoint(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_auto_setpoint_scale(unid, endpoint_id)) { + return true; + } + if (true == dotdot_is_supported_unify_humidity_control_auto_setpoint_precision(unid, endpoint_id)) { + return true; + } + + return false; +} + +bool dotdot_is_any_unify_humidity_control_writable_attribute_supported( + const dotdot_unid_t unid, + const dotdot_endpoint_id_t endpoint_id) { + + if (true == dotdot_is_supported_unify_humidity_control_reporting_mode(unid, endpoint_id)) { + return true; + } + return false; } diff --git a/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_registration.cpp b/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_registration.cpp index 0423e9305..bffe67aa8 100644 --- a/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_registration.cpp +++ b/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_registration.cpp @@ -17311,6 +17311,462 @@ sl_status_t unify_dotdot_attribute_store_registration_init() // clang-format off // clang-format on + { + // ModeType // ModeType // ModeType + std::string attribute_type_string = "ModeType"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl ReportingMode, " + "type: ModeType // ModeType"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_REPORTING_MODE, + "ZCL UnifyHumidityControl ReportingMode", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // map8 // map8 // uint8_t + std::string attribute_type_string = "uint8_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl SupportedReportingMode, " + "type: map8 // uint8_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_REPORTING_MODE, + "ZCL UnifyHumidityControl SupportedReportingMode", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // enum8 // enum8 // uint8_t + std::string attribute_type_string = "uint8_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl CurrentState, " + "type: enum8 // uint8_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_CURRENT_STATE, + "ZCL UnifyHumidityControl CurrentState", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // map8 // map8 // uint8_t + std::string attribute_type_string = "uint8_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl SupportedSetPoints, " + "type: map8 // uint8_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_SUPPORTED_SET_POINTS, + "ZCL UnifyHumidityControl SupportedSetPoints", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // int32 // int32 // int32_t + std::string attribute_type_string = "int32_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl HumidifierSetpointMin, " + "type: int32 // int32_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MIN, + "ZCL UnifyHumidityControl HumidifierSetpointMin", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // int32 // int32 // int32_t + std::string attribute_type_string = "int32_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl HumidifierSetpointMax, " + "type: int32 // int32_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_MAX, + "ZCL UnifyHumidityControl HumidifierSetpointMax", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // int32 // int32 // int32_t + std::string attribute_type_string = "int32_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl HumidifierSetpoint, " + "type: int32 // int32_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT, + "ZCL UnifyHumidityControl HumidifierSetpoint", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // ScaleType // ScaleType // ScaleType + std::string attribute_type_string = "ScaleType"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl HumidifierSetpointScale, " + "type: ScaleType // ScaleType"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_SCALE, + "ZCL UnifyHumidityControl HumidifierSetpointScale", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // uint8 // uint8 // uint8_t + std::string attribute_type_string = "uint8_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl HumidifierSetpointPrecision, " + "type: uint8 // uint8_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_HUMIDIFIER_SETPOINT_PRECISION, + "ZCL UnifyHumidityControl HumidifierSetpointPrecision", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // int32 // int32 // int32_t + std::string attribute_type_string = "int32_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl DehumidifierSetpointMin, " + "type: int32 // int32_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MIN, + "ZCL UnifyHumidityControl DehumidifierSetpointMin", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // int32 // int32 // int32_t + std::string attribute_type_string = "int32_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl DehumidifierSetpointMax, " + "type: int32 // int32_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_MAX, + "ZCL UnifyHumidityControl DehumidifierSetpointMax", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // int32 // int32 // int32_t + std::string attribute_type_string = "int32_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl DehumidifierSetpoint, " + "type: int32 // int32_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT, + "ZCL UnifyHumidityControl DehumidifierSetpoint", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // ScaleType // ScaleType // ScaleType + std::string attribute_type_string = "ScaleType"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl DehumidifierSetpointScale, " + "type: ScaleType // ScaleType"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_SCALE, + "ZCL UnifyHumidityControl DehumidifierSetpointScale", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // uint8 // uint8 // uint8_t + std::string attribute_type_string = "uint8_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl DehumidifierSetpointPrecision, " + "type: uint8 // uint8_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_DEHUMIDIFIER_SETPOINT_PRECISION, + "ZCL UnifyHumidityControl DehumidifierSetpointPrecision", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // int32 // int32 // int32_t + std::string attribute_type_string = "int32_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl AutoSetpointMin, " + "type: int32 // int32_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MIN, + "ZCL UnifyHumidityControl AutoSetpointMin", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // int32 // int32 // int32_t + std::string attribute_type_string = "int32_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl AutoSetpointMax, " + "type: int32 // int32_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_MAX, + "ZCL UnifyHumidityControl AutoSetpointMax", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // int32 // int32 // int32_t + std::string attribute_type_string = "int32_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl AutoSetpoint, " + "type: int32 // int32_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT, + "ZCL UnifyHumidityControl AutoSetpoint", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // ScaleType // ScaleType // ScaleType + std::string attribute_type_string = "ScaleType"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl AutoSetpointScale, " + "type: ScaleType // ScaleType"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_SCALE, + "ZCL UnifyHumidityControl AutoSetpointScale", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + + { + // uint8 // uint8 // uint8_t + std::string attribute_type_string = "uint8_t"; + attribute_store_storage_type_t storage_type = UNKNOWN_STORAGE_TYPE; + + // clang-format off + storage_type = attribute_storage_type_conversion(attribute_type_string); + + if (storage_type == UNKNOWN_STORAGE_TYPE) { + sl_log_warning(LOG_TAG, + "Unkown storage type for ZCL UnifyHumidityControl AutoSetpointPrecision, " + "type: uint8 // uint8_t"); + } + + status |= attribute_store_register_type( + DOTDOT_ATTRIBUTE_ID_UNIFY_HUMIDITY_CONTROL_AUTO_SETPOINT_PRECISION, + "ZCL UnifyHumidityControl AutoSetpointPrecision", + ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, + storage_type); + } + + // clang-format off + // clang-format on + // Additional attributes: for (auto const &a: zcl_additional_attribute_schema) { status |= attribute_store_register_type(a.type, diff --git a/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_write_attributes_command_callbacks.c b/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_write_attributes_command_callbacks.c index f45d19784..8f284f5cf 100644 --- a/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_write_attributes_command_callbacks.c +++ b/components/unify_dotdot_attribute_store/zap-generated/src/unify_dotdot_attribute_store_write_attributes_command_callbacks.c @@ -2585,6 +2585,40 @@ static sl_status_t descriptor_cluster_write_attributes_callback( endpoint_id); return SL_STATUS_OK; } +//////////////////////////////////////////////////////////////////////////////// +// Start of cluster UnifyHumidityControl +//////////////////////////////////////////////////////////////////////////////// +// WriteAttribute Callbacks unify_humidity_control +static sl_status_t unify_humidity_control_cluster_write_attributes_callback( + const dotdot_unid_t unid, + dotdot_endpoint_id_t endpoint_id, + uic_mqtt_dotdot_callback_call_type_t call_type, + uic_mqtt_dotdot_unify_humidity_control_state_t attributes, + uic_mqtt_dotdot_unify_humidity_control_updated_state_t updated_attributes) +{ + if (false == is_write_attributes_enabled()) { + return SL_STATUS_FAIL; + } + + if (call_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK) { + if (is_automatic_deduction_of_supported_commands_enabled()) { + return dotdot_is_any_unify_humidity_control_writable_attribute_supported(unid, endpoint_id) ? + SL_STATUS_OK : SL_STATUS_FAIL; + } else { + return SL_STATUS_FAIL; + } + } + + sl_log_debug(LOG_TAG, + "unify_humidity_control: Incoming WriteAttributes command for %s, endpoint %d.\n", + unid, + endpoint_id); + if (true == updated_attributes.reporting_mode) { + sl_log_debug(LOG_TAG, "Updating desired value for ReportingMode attribute"); + dotdot_set_unify_humidity_control_reporting_mode(unid, endpoint_id, DESIRED_ATTRIBUTE, attributes.reporting_mode); + } + return SL_STATUS_OK; +} // clang-format on //////////////////////////////////////////////////////////////////////////////// @@ -2752,6 +2786,9 @@ sl_status_t uic_mqtt_dotdot_set_descriptor_write_attributes_callback( &descriptor_cluster_write_attributes_callback); + uic_mqtt_dotdot_set_unify_humidity_control_write_attributes_callback( + &unify_humidity_control_cluster_write_attributes_callback); + // clang-format on return SL_STATUS_OK; diff --git a/components/unify_dotdot_attribute_store/zap-generated/test/unify_dotdot_attribute_store_test.c b/components/unify_dotdot_attribute_store/zap-generated/test/unify_dotdot_attribute_store_test.c index fda0a48f1..e4432b960 100644 --- a/components/unify_dotdot_attribute_store/zap-generated/test/unify_dotdot_attribute_store_test.c +++ b/components/unify_dotdot_attribute_store/zap-generated/test/unify_dotdot_attribute_store_test.c @@ -1312,6 +1312,24 @@ uic_mqtt_dotdot_descriptor_write_attributes_callback_t get_uic_mqtt_dotdot_descr return test_uic_mqtt_dotdot_descriptor_write_attributes_callback; } +static uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback_t test_uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback = NULL; +static uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback_t test_uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback = NULL; + +uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback_t get_uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback(){ + return test_uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback; +} +uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback_t get_uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback(){ + return test_uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback; +} + +static uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_t test_uic_mqtt_dotdot_unify_humidity_control_mode_set_callback = NULL; +uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_t get_uic_mqtt_dotdot_unify_humidity_control_mode_set_callback(){ + return test_uic_mqtt_dotdot_unify_humidity_control_mode_set_callback; +} +static uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_t test_uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback = NULL; +uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_t get_uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback(){ + return test_uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback; +} // clang-format on #define TEST_UNID "test-unid-123" @@ -2878,6 +2896,26 @@ void set_uic_mqtt_dotdot_descriptor_write_attributes_callback_stub( { test_uic_mqtt_dotdot_descriptor_write_attributes_callback = callback; } +void set_uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback_stub( + const uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback_t callback, int cmock_num_calls) +{ + test_uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback = callback; +} +void set_uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback_stub( + const uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback_t callback, int cmock_num_calls) +{ + test_uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_set_stub( + const uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_t callback, int cmock_num_calls) +{ + test_uic_mqtt_dotdot_unify_humidity_control_mode_set_callback = callback; +} +void uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_set_stub( + const uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_t callback, int cmock_num_calls) +{ + test_uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback = callback; +} // clang-format on // Test functions @@ -3798,6 +3836,18 @@ void setUp() test_uic_mqtt_dotdot_descriptor_write_attributes_callback = NULL; uic_mqtt_dotdot_set_descriptor_write_attributes_callback_Stub( &set_uic_mqtt_dotdot_descriptor_write_attributes_callback_stub); + test_uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback = NULL; + uic_mqtt_dotdot_set_unify_humidity_control_force_read_attributes_callback_Stub( + &set_uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback_stub); + test_uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback = NULL; + uic_mqtt_dotdot_set_unify_humidity_control_write_attributes_callback_Stub( + &set_uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback_stub); + test_uic_mqtt_dotdot_unify_humidity_control_mode_set_callback = NULL; + uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_set_Stub( + &uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_set_stub); + test_uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback = NULL; + uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_set_Stub( + &uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_set_stub); // clang-format on group_command_dispatch = NULL; @@ -4560,6 +4610,25 @@ void test_automatic_deduction_of_supported_commands() TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_aox_position_estimation_position(expected_unid,expected_endpoint_id) ); TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_protocol_controller_network_management_network_management_state(expected_unid,expected_endpoint_id) ); TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_descriptor_device_type_list(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_reporting_mode(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_supported_reporting_mode(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_current_state(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_supported_set_points(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_humidifier_setpoint_min(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_humidifier_setpoint_max(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_humidifier_setpoint(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_humidifier_setpoint_scale(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_humidifier_setpoint_precision(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_dehumidifier_setpoint_min(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_dehumidifier_setpoint_max(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_dehumidifier_setpoint(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_dehumidifier_setpoint_scale(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_dehumidifier_setpoint_precision(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_auto_setpoint_min(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_auto_setpoint_max(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_auto_setpoint(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_auto_setpoint_scale(expected_unid,expected_endpoint_id) ); + TEST_ASSERT_EQUAL(SL_STATUS_OK, dotdot_create_unify_humidity_control_auto_setpoint_precision(expected_unid,expected_endpoint_id) ); // clang-format on // ColorControl checks the value in the bitmask: @@ -7695,6 +7764,40 @@ void test_automatic_deduction_of_supported_commands() )); } + if (NULL != test_uic_mqtt_dotdot_unify_humidity_control_mode_set_callback) { + // Dummy command parameters + ModeType mode_value; + memset(&mode_value, 0x00, sizeof(mode_value)); + // Invoke with support check + TEST_ASSERT_EQUAL(SL_STATUS_FAIL, test_uic_mqtt_dotdot_unify_humidity_control_mode_set_callback(expected_unid,expected_endpoint_id,UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK + , + mode_value + + )); + } + if (NULL != test_uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback) { + // Dummy command parameters + SetpointType type_value; + memset(&type_value, 0x00, sizeof(type_value)); + uint8_t precision_value; + memset(&precision_value, 0x00, sizeof(precision_value)); + uint8_t scale_value; + memset(&scale_value, 0x00, sizeof(scale_value)); + int32_t value_value; + memset(&value_value, 0x00, sizeof(value_value)); + // Invoke with support check + TEST_ASSERT_EQUAL(SL_STATUS_FAIL, test_uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback(expected_unid,expected_endpoint_id,UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK + , + type_value, + + precision_value, + + scale_value, + + value_value + + )); + } // Invoke all commands with support check, they should return SL_STATUS_OK // because all ZCL attributes are supported @@ -10822,5 +10925,39 @@ void test_automatic_deduction_of_supported_commands() )); } + if (NULL != test_uic_mqtt_dotdot_unify_humidity_control_mode_set_callback) { + // Dummy command parameters + ModeType mode_value; + memset(&mode_value, 0x00, sizeof(mode_value)); + // Invoke with support check + TEST_ASSERT_EQUAL(SL_STATUS_OK, test_uic_mqtt_dotdot_unify_humidity_control_mode_set_callback(expected_unid,expected_endpoint_id,UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK + , + mode_value + + )); + } + if (NULL != test_uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback) { + // Dummy command parameters + SetpointType type_value; + memset(&type_value, 0x00, sizeof(type_value)); + uint8_t precision_value; + memset(&precision_value, 0x00, sizeof(precision_value)); + uint8_t scale_value; + memset(&scale_value, 0x00, sizeof(scale_value)); + int32_t value_value; + memset(&value_value, 0x00, sizeof(value_value)); + // Invoke with support check + TEST_ASSERT_EQUAL(SL_STATUS_OK, test_uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback(expected_unid,expected_endpoint_id,UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK + , + type_value, + + precision_value, + + scale_value, + + value_value + + )); + } } diff --git a/components/unify_dotdot_attribute_store/zap-generated/test/unify_dotdot_attribute_store_test.h b/components/unify_dotdot_attribute_store/zap-generated/test/unify_dotdot_attribute_store_test.h index 5d7b13dc5..63741c0ec 100644 --- a/components/unify_dotdot_attribute_store/zap-generated/test/unify_dotdot_attribute_store_test.h +++ b/components/unify_dotdot_attribute_store/zap-generated/test/unify_dotdot_attribute_store_test.h @@ -793,4 +793,14 @@ uic_mqtt_dotdot_descriptor_force_read_attributes_callback_t get_uic_mqtt_dotdot_descriptor_force_read_attributes_callback(); uic_mqtt_dotdot_descriptor_write_attributes_callback_t get_uic_mqtt_dotdot_descriptor_write_attributes_callback(); + + uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback_t get_uic_mqtt_dotdot_unify_humidity_control_force_read_attributes_callback(); + uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback_t get_uic_mqtt_dotdot_unify_humidity_control_write_attributes_callback(); + + + uic_mqtt_dotdot_unify_humidity_control_mode_set_callback_t get_uic_mqtt_dotdot_unify_humidity_control_mode_set_callback(); + + + uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback_t get_uic_mqtt_dotdot_unify_humidity_control_setpoint_set_callback(); + #endif // UNIFY_DOTDOT_ATTRIBUTE_STORE_TEST_H \ No newline at end of file