Skip to content

Commit 59de367

Browse files
P-R-O-C-H-YCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent df4d564 commit 59de367

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

docs/en/zigbee/ep_color_dimmable_light.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ Gets the current active color mode.
352352
uint8_t getLightColorMode();
353353
354354
This function will return current color mode:
355-
* ``ZIGBEE_COLOR_MODE_CURRENT_X_Y`` (0x01) - XY/RGB mode
356355
* ``ZIGBEE_COLOR_MODE_HUE_SATURATION`` (0x00) - HSV mode
356+
* ``ZIGBEE_COLOR_MODE_CURRENT_X_Y`` (0x01) - XY/RGB mode
357357
* ``ZIGBEE_COLOR_MODE_TEMPERATURE`` (0x02) - Temperature mode
358358

359359
getLightColorHue

libraries/Zigbee/keywords.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ getLightColorMode KEYWORD2
123123
getLightColorHue KEYWORD2
124124
getLightColorSaturation KEYWORD2
125125
getLightColorCapabilities KEYWORD2
126-
onLightChange KEYWORD2 KEYWORD2
126+
onLightChange KEYWORD2
127127
onLightChangeRgb KEYWORD2
128128
onLightChangeHsv KEYWORD2
129129
onLightChangeTemp KEYWORD2
@@ -133,7 +133,6 @@ onLightLevelChangeWithSource KEYWORD2
133133
onLightStateChange KEYWORD2
134134
onLightStateChangeWithSource KEYWORD2
135135

136-
137136
# ZigbeeSwitch + ZigbeeColorDimmerSwitch
138137
lightToggle KEYWORD2
139138
lightOn KEYWORD2

libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ ZigbeeColorDimmableLight::ZigbeeColorDimmableLight(uint8_t endpoint) : ZigbeeEP(
2626
uint8_t hue = 0;
2727
uint8_t saturation = 0;
2828

29-
//Add support for Hue and Saturation
30-
uint16_t color_attr = ESP_ZB_ZCL_COLOR_CONTROL_COLOR_TEMPERATURE_DEF_VALUE;
29+
// Add support for Color Temperature and Hue Saturation attributes
30+
uint16_t color_temperature = ESP_ZB_ZCL_COLOR_CONTROL_COLOR_TEMPERATURE_DEF_VALUE;
3131
uint16_t min_temp = ESP_ZB_ZCL_COLOR_CONTROL_COLOR_TEMP_PHYSICAL_MIN_MIREDS_DEFAULT_VALUE;
3232
uint16_t max_temp = ESP_ZB_ZCL_COLOR_CONTROL_COLOR_TEMP_PHYSICAL_MAX_MIREDS_DEFAULT_VALUE;
3333

3434
esp_zb_attribute_list_t *color_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_COLOR_CONTROL, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
3535
esp_zb_color_control_cluster_add_attr(color_cluster, ESP_ZB_ZCL_ATTR_COLOR_CONTROL_CURRENT_HUE_ID, &hue);
3636
esp_zb_color_control_cluster_add_attr(color_cluster, ESP_ZB_ZCL_ATTR_COLOR_CONTROL_CURRENT_SATURATION_ID, &saturation);
37-
esp_zb_color_control_cluster_add_attr(color_cluster, ESP_ZB_ZCL_ATTR_COLOR_CONTROL_COLOR_TEMPERATURE_ID, &color_attr);
37+
esp_zb_color_control_cluster_add_attr(color_cluster, ESP_ZB_ZCL_ATTR_COLOR_CONTROL_COLOR_TEMPERATURE_ID, &color_temperature);
3838
esp_zb_color_control_cluster_add_attr(color_cluster, ESP_ZB_ZCL_ATTR_COLOR_CONTROL_COLOR_TEMP_PHYSICAL_MIN_MIREDS_ID, &min_temp);
3939
esp_zb_color_control_cluster_add_attr(color_cluster, ESP_ZB_ZCL_ATTR_COLOR_CONTROL_COLOR_TEMP_PHYSICAL_MAX_MIREDS_ID, &max_temp);
4040
uint8_t color_mode = ESP_ZB_ZCL_COLOR_CONTROL_COLOR_MODE_DEFAULT_VALUE;

libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#define ZIGBEE_COLOR_CAPABILITY_HUE_SATURATION (1 << 0) // Bit 0: Hue/saturation supported
6969
#define ZIGBEE_COLOR_CAPABILITY_ENHANCED_HUE (1 << 1) // Bit 1: Enhanced hue supported
7070
#define ZIGBEE_COLOR_CAPABILITY_COLOR_LOOP (1 << 2) // Bit 2: Color loop supported
71-
#define ZIGBEE_COLOR_CAPABILITY_X_Y (1 << 3) // Bit 3: XY supported
71+
#define ZIGBEE_COLOR_CAPABILITY_X_Y (1 << 3) // Bit 3: X/Y supported
7272
#define ZIGBEE_COLOR_CAPABILITY_COLOR_TEMP (1 << 4) // Bit 4: Color temperature supported
7373

7474
// Color mode enum values (matching ZCL spec)
@@ -146,8 +146,6 @@ class ZigbeeColorDimmableLight : public ZigbeeEP {
146146
return _color_capabilities;
147147
}
148148

149-
150-
151149
private:
152150
void zbAttributeSet(const esp_zb_zcl_set_attr_value_message_t *message) override;
153151
bool setLightColorMode(uint8_t color_mode);

0 commit comments

Comments
 (0)