ci(pre-commit): Apply automatic fixes · espressif/arduino-esp32@6e87b0d (original) (raw)

4 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -96,11 +96,11 @@ void setup() {
96 96 DimmableLight.onChange(setLightState);
97 97
98 98 // lambda functions are used to set the attribute change callbacks
99 - DimmableLight.onChangeOnOff([](bool state) {
100 - Serial.printf("Light OnOff changed to %s\r\n", state ? "ON" : "OFF");
99 + DimmableLight.onChangeOnOff([](bool state) {
100 + Serial.printf("Light OnOff changed to %s\r\n", state ? "ON" : "OFF");
101 101 return true;
102 102 });
103 - DimmableLight.onChangeBrightness([](uint8_t level) {
103 + DimmableLight.onChangeBrightness([](uint8_t level) {
104 104 Serial.printf("Light Brightness changed to %d\r\n", level);
105 105 return true;
106 106 });
@@ -111,7 +111,7 @@ void setup() {
111 111 if (Matter.isDeviceCommissioned()) {
112 112 Serial.println("Matter Node is commissioned and connected to Wi-Fi. Ready for use.");
113 113 Serial.printf("Initial state: %s | brightness: %d\r\n", DimmableLight ? "ON" : "OFF", DimmableLight.getBrightness());
114 -// configure the Light based on initial on-off state and brightness
114 +// configure the Light based on initial on-off state and brightness
115 115 DimmableLight.updateAccessory();
116 116 }
117 117 }
@@ -139,7 +139,7 @@ void loop() {
139 139 }
140 140 }
141 141 Serial.printf("Initial state: %s | brightness: %d\r\n", DimmableLight ? "ON" : "OFF", DimmableLight.getBrightness());
142 -// configure the Light based on initial on-off state and brightness
142 +// configure the Light based on initial on-off state and brightness
143 143 DimmableLight.updateAccessory();
144 144 Serial.println("Matter Node is commissioned and connected to Wi-Fi. Ready for use.");
145 145 }
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ class MatterEndPoint {
30 30 }
31 31 // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary.
32 32 virtual bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val) = 0;
33 +
33 34 protected:
34 35 uint16_t endpoint_id = 0;
35 36 };
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ bool MatterDimmableLight::attributeChangeCB(uint16_t endpoint_id, uint32_t clust
33 33 log_d("Dimmable Attr update callback: endpoint: %u, cluster: %u, attribute: %u, val: %u", endpoint_id, cluster_id, attribute_id, val->val.u32);
34 34
35 35 if (endpoint_id == getEndPointId()) {
36 -switch(cluster_id) {
36 +switch (cluster_id) {
37 37 case OnOff::Id:
38 38 if (attribute_id == OnOff::Attributes::OnOff::Id) {
39 39 log_d("DimmableLight On/Off State changed to %d", val->val.b);
@@ -61,7 +61,7 @@ bool MatterDimmableLight::attributeChangeCB(uint16_t endpoint_id, uint32_t clust
61 61 brightnessLevel = val->val.u8;
62 62 }
63 63 }
64 -break;
64 +break;
65 65 }
66 66 }
67 67 return ret;
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ bool MatterOnOffLight::attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_
29 29 log_e("Matter On-Off Light device has not begun.");
30 30 return false;
31 31 }
32 -
32 +
33 33 log_d("OnOff Attr update callback: endpoint: %u, cluster: %u, attribute: %u, val: %u", endpoint_id, cluster_id, attribute_id, val->val.u32);
34 34
35 35 if (endpoint_id == getEndPointId()) {