Skip to content

Commit 56af488

Browse files
ci(pre-commit): Apply automatic fixes
1 parent 443e461 commit 56af488

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

Diff for: libraries/Zigbee/examples/Zigbee_Thermostat/Zigbee_Thermostat.ino

+8-8
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ float sensor_max_temp;
4545
float sensor_min_temp;
4646
float sensor_tolerance;
4747

48-
struct tm timeinfo = {}; // Time structure for Time cluster
48+
struct tm timeinfo = {}; // Time structure for Time cluster
4949

5050
/****************** Temperature sensor handling *******************/
5151
void recieveSensorTemp(float temperature) {
@@ -75,16 +75,16 @@ void setup() {
7575

7676
//Optional Time cluster configuration
7777
//example time January 13, 2025 13:30:30 CET
78-
timeinfo.tm_year = 2025 - 1900; // = 2025
79-
timeinfo.tm_mon = 0; // January
80-
timeinfo.tm_mday = 13; // 13th
81-
timeinfo.tm_hour = 12; // 12 hours - 1 hour (CET)
82-
timeinfo.tm_min = 30; // 30 minutes
83-
timeinfo.tm_sec = 30; // 30 seconds
78+
timeinfo.tm_year = 2025 - 1900; // = 2025
79+
timeinfo.tm_mon = 0; // January
80+
timeinfo.tm_mday = 13; // 13th
81+
timeinfo.tm_hour = 12; // 12 hours - 1 hour (CET)
82+
timeinfo.tm_min = 30; // 30 minutes
83+
timeinfo.tm_sec = 30; // 30 seconds
8484
timeinfo.tm_isdst = -1;
8585

8686
// Set time and gmt offset (timezone in seconds -> CET = +3600 seconds)
87-
zbThermostat.addTimeCluster(timeinfo, 3600);
87+
zbThermostat.addTimeCluster(timeinfo, 3600);
8888

8989
//Add endpoint to Zigbee Core
9090
Zigbee.addEndpoint(&zbThermostat);

Diff for: libraries/Zigbee/src/ZigbeeEP.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ void ZigbeeEP::addTimeCluster(tm time, int32_t gmt_offset) {
256256
// Add time clusters to cluster list
257257
esp_zb_cluster_list_add_time_cluster(_cluster_list, time_cluster_server, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
258258
esp_zb_cluster_list_add_time_cluster(_cluster_list, time_cluster_client, ESP_ZB_ZCL_CLUSTER_CLIENT_ROLE);
259-
260259
}
261260

262261
void ZigbeeEP::setTime(tm time) {
@@ -356,8 +355,7 @@ void ZigbeeEP::zbReadTimeCluster(const esp_zb_zcl_attribute_t *attribute) {
356355
log_v("Time: %lld", *(uint32_t *)attribute->data.value);
357356
_read_time = *(uint32_t *)attribute->data.value;
358357
xSemaphoreGive(lock);
359-
}
360-
else if (attribute->id == ESP_ZB_ZCL_ATTR_TIME_TIME_ZONE_ID && attribute->data.type == ESP_ZB_ZCL_ATTR_TYPE_S32) {
358+
} else if (attribute->id == ESP_ZB_ZCL_ATTR_TIME_TIME_ZONE_ID && attribute->data.type == ESP_ZB_ZCL_ATTR_TYPE_S32) {
361359
log_v("Timezone attribute received");
362360
log_v("Timezone: %d", *(int32_t *)attribute->data.value);
363361
_read_timezone = *(int32_t *)attribute->data.value;

Diff for: libraries/Zigbee/src/ZigbeeEP.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,13 @@ class ZigbeeEP {
9595
void reportBatteryPercentage();
9696

9797
// Set time
98-
void addTimeCluster(tm time = {0}, int32_t gmt_offset = 0); // gmt offset in seconds
98+
void addTimeCluster(tm time = {0}, int32_t gmt_offset = 0); // gmt offset in seconds
9999
void setTime(tm time);
100100
void setTimezone(int32_t gmt_offset);
101101

102102
// Get time from Coordinator or specific endpoint (blocking until response)
103103
struct tm getTime(uint8_t endpoint = 1, int32_t short_addr = 0x0000, esp_zb_ieee_addr_t ieee_addr = {0});
104-
int32_t getTimezone(uint8_t endpoint = 1, int32_t short_addr = 0x0000, esp_zb_ieee_addr_t ieee_addr = {0}); // gmt offset in seconds
105-
104+
int32_t getTimezone(uint8_t endpoint = 1, int32_t short_addr = 0x0000, esp_zb_ieee_addr_t ieee_addr = {0}); // gmt offset in seconds
106105

107106
bool epAllowMultipleBinding() {
108107
return _allow_multiple_binding;
@@ -116,7 +115,7 @@ class ZigbeeEP {
116115
virtual void zbAttributeRead(uint16_t cluster_id, const esp_zb_zcl_attribute_t *attribute) {};
117116
virtual void zbReadBasicCluster(const esp_zb_zcl_attribute_t *attribute); //already implemented
118117
virtual void zbIdentify(const esp_zb_zcl_set_attr_value_message_t *message);
119-
virtual void zbReadTimeCluster(const esp_zb_zcl_attribute_t *attribute); //already implemented
118+
virtual void zbReadTimeCluster(const esp_zb_zcl_attribute_t *attribute); //already implemented
120119

121120
virtual void zbIASZoneStatusChangeNotification(const esp_zb_zcl_ias_zone_status_change_notification_message_t *message) {};
122121

Diff for: libraries/Zigbee/src/ep/ZigbeePressureSensor.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ ZigbeePressureSensor::ZigbeePressureSensor(uint8_t endpoint) : ZigbeeEP(endpoint
2525
void ZigbeePressureSensor::setMinMaxValue(int16_t min, int16_t max) {
2626

2727
esp_zb_attribute_list_t *pressure_measure_cluster =
28-
esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
28+
esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
2929
esp_zb_cluster_update_attr(pressure_measure_cluster, ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_MIN_VALUE_ID, (void *)&min);
3030
esp_zb_cluster_update_attr(pressure_measure_cluster, ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_MAX_VALUE_ID, (void *)&max);
3131
}
3232

3333
void ZigbeePressureSensor::setTolerance(uint16_t tolerance) {
3434
esp_zb_attribute_list_t *pressure_measure_cluster =
35-
esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
35+
esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
3636
esp_zb_temperature_meas_cluster_add_attr(pressure_measure_cluster, ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_TOLERANCE_ID, (void *)&tolerance);
3737
}
3838

0 commit comments

Comments
 (0)