light: Change color_dimmable_light to color_temperature_light

Added support for temperature in app_driver.
Adding hue and saturation after the color_temperature_light endpoint has been created.
Similar changes in other light examples.
This commit is contained in:
Chirag Atal
2022-05-26 16:52:59 +05:30
committed by Shu Chen
parent 11a898f973
commit 743f5cd90e
12 changed files with 83 additions and 11 deletions
@@ -827,7 +827,8 @@ void val_print(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id,
} else if (val->type == ESP_MATTER_VAL_TYPE_FLOAT) {
ESP_LOGI(TAG, "********** Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %f **********", endpoint_id,
cluster_id, attribute_id, val->val.f);
} else if (val->type == ESP_MATTER_VAL_TYPE_UINT8 || val->type == ESP_MATTER_VAL_TYPE_BITMAP8) {
} else if (val->type == ESP_MATTER_VAL_TYPE_UINT8 || val->type == ESP_MATTER_VAL_TYPE_BITMAP8
|| val->type == ESP_MATTER_VAL_TYPE_ENUM8) {
ESP_LOGI(TAG, "********** Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %d **********", endpoint_id,
cluster_id, attribute_id, val->val.u8);
} else if (val->type == ESP_MATTER_VAL_TYPE_INT16) {
@@ -25,6 +25,14 @@
*/
#define REMAP_TO_RANGE(value, from, to) ((value * to) / from)
/** Remap attribute values with inverse dependency
*
* This can be used to remap attribute values with inverse dependency to different ranges.
* Example: To convert the temperature mireds into temperature kelvin and vice-versa where the relation between them
* is: Mireds = 1,000,000/Kelvin.
*/
#define REMAP_TO_RANGE_INVERSE(value, factor) (factor / value)
/** ESP Matter Attribute Value type */
typedef enum {
/** Invalid */
+2 -2
View File
@@ -99,9 +99,9 @@ typedef struct config {
uint16_t color_temp_physical_max_mireds;
uint16_t couple_color_temp_to_level_min_mireds;
uint16_t startup_color_temperature_mireds;
config() : color_temperature_mireds(0x00fa), color_temp_physical_min_mireds(0),
config() : color_temperature_mireds(0x00fa), color_temp_physical_min_mireds(1),
color_temp_physical_max_mireds(0xfeff), couple_color_temp_to_level_min_mireds(0),
startup_color_temperature_mireds(0) {}
startup_color_temperature_mireds(0x00fa) {}
} config_t;
uint32_t get_id();