@@ -2017,6 +2017,39 @@ esp_err_t add(endpoint_t *endpoint, config_t *config)
2017
2017
}
2018
2018
} /* mounted_dimmable_load_control */
2019
2019
2020
+ namespace water_heater {
2021
+ uint32_t get_device_type_id ()
2022
+ {
2023
+ return ESP_MATTER_WATER_HEATER_DEVICE_TYPE_ID;
2024
+ }
2025
+
2026
+ uint8_t get_device_type_version ()
2027
+ {
2028
+ return ESP_MATTER_WATER_HEATER_DEVICE_TYPE_VERSION;
2029
+ }
2030
+
2031
+ endpoint_t *create (node_t *node, config_t *config, uint8_t flags, void *priv_data)
2032
+ {
2033
+ return common::create<config_t >(node, config, flags, priv_data, add);
2034
+ }
2035
+
2036
+ esp_err_t add (endpoint_t *endpoint, config_t *config)
2037
+ {
2038
+ VerifyOrReturnError (endpoint != nullptr , ESP_ERR_INVALID_ARG, ESP_LOGE (TAG, " Endpoint cannot be NULL" ));
2039
+ esp_err_t err = add_device_type (endpoint, get_device_type_id (), get_device_type_version ());
2040
+ if (err != ESP_OK) {
2041
+ ESP_LOGE (TAG, " Failed to add device type id:%" PRIu32 " ,err: %d" , get_device_type_id (), err);
2042
+ return err;
2043
+ }
2044
+
2045
+ cluster::thermostat::create (endpoint, &(config->thermostat ), CLUSTER_FLAG_SERVER, cluster::thermostat::feature::heating::get_id ());
2046
+ water_heater_management::create (endpoint, &(config->water_heater_management ), CLUSTER_FLAG_SERVER, ESP_MATTER_NONE_FEATURE_ID);
2047
+ water_heater_mode::create (endpoint, &(config->water_heater_mode ), CLUSTER_FLAG_SERVER);
2048
+
2049
+ return ESP_OK;
2050
+ }
2051
+ } /* water_heater */
2052
+
2020
2053
} /* endpoint */
2021
2054
2022
2055
namespace node {
0 commit comments