Skip to content

Commit

Permalink
feat(Zigbee): Applied formatter + add formatter protection
Browse files Browse the repository at this point in the history
As suggested by code review
  • Loading branch information
FaBjE committed Dec 14, 2024
1 parent 42f9cfc commit ff7e504
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions libraries/Zigbee/src/ep/ZigbeeDimmableLight.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
*
*/
typedef struct zigbee_dimmable_light_cfg_s {
typedef struct zigbee_dimmable_light_cfg_s
{
esp_zb_basic_cluster_cfg_t basic_cfg; /*!< Basic cluster configuration, @ref esp_zb_basic_cluster_cfg_s */
esp_zb_identify_cluster_cfg_t identify_cfg; /*!< Identify cluster configuration, @ref esp_zb_identify_cluster_cfg_s */
esp_zb_groups_cluster_cfg_t groups_cfg; /*!< Groups cluster configuration, @ref esp_zb_groups_cluster_cfg_s */
Expand All @@ -29,6 +30,7 @@ typedef struct zigbee_dimmable_light_cfg_s {
* Added here as not supported by ESP Zigbee library.
*
*/
// clang-format off
#define ZIGBEE_DEFAULT_DIMMABLE_LIGHT_CONFIG() \
{ \
.basic_cfg = \
Expand Down Expand Up @@ -61,27 +63,33 @@ typedef struct zigbee_dimmable_light_cfg_s {
.current_level = ESP_ZB_ZCL_LEVEL_CONTROL_CURRENT_LEVEL_DEFAULT_VALUE, \
}, \
}
// clang-format on

class ZigbeeDimmableLight : public ZigbeeEP {
class ZigbeeDimmableLight : public ZigbeeEP
{
public:
ZigbeeDimmableLight(uint8_t endpoint);
~ZigbeeDimmableLight();

void onLightChange(void (*callback)(bool, uint8_t)) {
void onLightChange(void (*callback)(bool, uint8_t))
{
_on_light_change = callback;
}
void restoreLight() {
void restoreLight()
{
lightChanged();
}

void setLightState(bool state);
void setLightLevel(uint8_t level);
void setLight(bool state, uint8_t level);

bool getLightState() {
bool getLightState()
{
return _current_state;
}
uint8_t getLightLevel() {
uint8_t getLightLevel()
{
return _current_level;
}

Expand All @@ -108,4 +116,4 @@ class ZigbeeDimmableLight : public ZigbeeEP {
uint8_t _current_level;
};

#endif // SOC_IEEE802154_SUPPORTED
#endif // SOC_IEEE802154_SUPPORTED

0 comments on commit ff7e504

Please sign in to comment.