Skip to content

Commit

Permalink
fix(): Codespell issues
Browse files Browse the repository at this point in the history
  • Loading branch information
P-R-O-C-H-Y committed Oct 2, 2024
1 parent 3961642 commit 7d763df
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void setup() {
}

void loop() {
// Cheking button for factory reset
// Checking button for factory reset
if (digitalRead(BUTTON_PIN) == LOW) { // Push button pressed
// Key debounce handling
delay(100);
Expand All @@ -95,7 +95,7 @@ void loop() {
delay(50);
if ((millis() - startTime) > 3000) {
// If key pressed for more than 3secs, factory reset Zigbee and reboot
Serial.printf("Reseting Zigbee to factory settings, reboot.\n");
Serial.printf("Resetting Zigbee to factory settings, reboot.\n");
Zigbee.factoryReset();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void loop() {
// Toggle light
zbSwitch.lightToggle();
}
// Handle serial input to controll color and level of the light
// Handle serial input to control color and level of the light
if (Serial.available()) {
String command = Serial.readString();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void setup() {
}

void loop() {
// Cheking button for factory reset
// Checking button for factory reset
if (digitalRead(BUTTON_PIN) == LOW) { // Push button pressed
// Key debounce handling
delay(100);
Expand All @@ -78,7 +78,7 @@ void loop() {
delay(50);
if ((millis() - startTime) > 3000) {
// If key pressed for more than 3secs, factory reset Zigbee and reboot
Serial.printf("Reseting Zigbee to factory settings, reboot.\n");
Serial.printf("Resetting Zigbee to factory settings, reboot.\n");
Zigbee.factoryReset();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ void setup() {
// Set reporting interval for temperature measurement in seconds, must be called after Zigbee.begin()
// min_interval and max_interval in seconds, delta (temp change in °C)
// if min = 1 and max = 0, reporting is sent only when temperature changes by delta
// if min = 0 and max = 10, reporting is sent every 10 secods or temperature changes by delta
// if min = 0 and max = 10, reporting is sent every 10 seconds or temperature changes by delta
// if min = 0, max = 10 and delta = 0, reporting is sent every 10 seconds regardless of temperature change
zbTempSensor.setReporting(1, 0, 1);
}

void loop() {
// Cheking button for factory reset
// Checking button for factory reset
if (digitalRead(BUTTON_PIN) == LOW) { // Push button pressed
// Key debounce handling
delay(100);
Expand All @@ -97,7 +97,7 @@ void loop() {
delay(50);
if ((millis() - startTime) > 3000) {
// If key pressed for more than 3secs, factory reset Zigbee and reboot
Serial.printf("Reseting Zigbee to factory settings, reboot.\n");
Serial.printf("Resetting Zigbee to factory settings, reboot.\n");
Zigbee.factoryReset();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void setup() {
// Init button switch
pinMode(BUTTON_PIN, INPUT);

// Set callback functions for temperature and configuration recieve
// Set callback functions for temperature and configuration receive
zbThermostat.onTempRecieve(recieveSensorTemp);
zbThermostat.onConfigRecieve(recieveSensorConfig);

Expand Down
6 changes: 3 additions & 3 deletions libraries/Zigbee/src/ZigbeeCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void ZigbeeCore::setRebootOpenNetwork(uint8_t time) {

void ZigbeeCore::openNetwork(uint8_t time) {
if (_started) {
log_v("Openning network for joining for %d seconds", time);
log_v("Opening network for joining for %d seconds", time);
esp_zb_bdb_open_network(time);
}
}
Expand Down Expand Up @@ -198,7 +198,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) {
log_i("Device rebooted");
Zigbee._started = true;
if ((zigbee_role_t)Zigbee.getRole() == ZIGBEE_COORDINATOR && Zigbee._open_network > 0) {
log_i("Openning network for joining for %d seconds", Zigbee._open_network);
log_i("Opening network for joining for %d seconds", Zigbee._open_network);
esp_zb_bdb_open_network(Zigbee._open_network);
}
}
Expand Down Expand Up @@ -289,7 +289,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) {
}

void ZigbeeCore::factoryReset() {
log_v("Factory reseting Zigbee stack, device will reboot");
log_v("Factory resetting Zigbee stack, device will reboot");
esp_zb_factory_reset();
}

Expand Down
4 changes: 2 additions & 2 deletions libraries/Zigbee/src/ZigbeeEP.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <Arduino.h>

/* Usefull defines */
/* Useful defines */
#define ZB_ARRAY_LENTH(arr) (sizeof(arr) / sizeof(arr[0]))
#define print_ieee_addr(addr) \
log_i("IEEE Address: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5], addr[6], addr[7])
Expand Down Expand Up @@ -93,7 +93,7 @@ class ZigbeeEP {
// findEndpoind may be implemented by EPs to find and bind devices
virtual void findEndpoint(esp_zb_zdo_match_desc_req_param_t *cmd_req) {};

//list of all handlers function calls, to be overide by EPs implementation
//list of all handlers function calls, to be override by EPs implementation
virtual void zbAttributeSet(const esp_zb_zcl_set_attr_value_message_t *message) {};
virtual void zbAttributeRead(uint16_t cluster_id, const esp_zb_zcl_attribute_t *attribute) {};
virtual void zbReadBasicCluster(const esp_zb_zcl_attribute_t *attribute); //already implemented
Expand Down
10 changes: 5 additions & 5 deletions libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void ZigbeeColorDimmableLight::calculateRGB(uint16_t x, uint16_t y, uint8_t &red
blue = (uint8_t)(b * (float)255);
}

//set attribude method -> methon overriden in child class
//set attribute method -> method overridden in child class
void ZigbeeColorDimmableLight::zbAttributeSet(const esp_zb_zcl_set_attr_value_message_t *message) {
//check the data and call right method
if (message->info.cluster == ESP_ZB_ZCL_CLUSTER_ID_ON_OFF) {
Expand All @@ -58,7 +58,7 @@ void ZigbeeColorDimmableLight::zbAttributeSet(const esp_zb_zcl_set_attr_value_me
}
return;
} else {
log_w("Recieved message ignored. Attribute ID: %d not supported for On/Off Light", message->attribute.id);
log_w("Received message ignored. Attribute ID: %d not supported for On/Off Light", message->attribute.id);
}
} else if (message->info.cluster == ESP_ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL) {
if (message->attribute.id == ESP_ZB_ZCL_ATTR_LEVEL_CONTROL_CURRENT_LEVEL_ID && message->attribute.data.type == ESP_ZB_ZCL_ATTR_TYPE_U8) {
Expand All @@ -68,7 +68,7 @@ void ZigbeeColorDimmableLight::zbAttributeSet(const esp_zb_zcl_set_attr_value_me
}
return;
} else {
log_w("Recieved message ignored. Attribute ID: %d not supported for Level Control", message->attribute.id);
log_w("Received message ignored. Attribute ID: %d not supported for Level Control", message->attribute.id);
//TODO: implement more attributes -> includes/zcl/esp_zigbee_zcl_level.h
}
} else if (message->info.cluster == ESP_ZB_ZCL_CLUSTER_ID_COLOR_CONTROL) {
Expand Down Expand Up @@ -96,10 +96,10 @@ void ZigbeeColorDimmableLight::zbAttributeSet(const esp_zb_zcl_set_attr_value_me
lightChanged();
return;
} else {
log_w("Recieved message ignored. Attribute ID: %d not supported for Color Control", message->attribute.id);
log_w("Received message ignored. Attribute ID: %d not supported for Color Control", message->attribute.id);
}
} else {
log_w("Recieved message ignored. Cluster ID: %d not supported for Color dimmable Light", message->info.cluster);
log_w("Received message ignored. Cluster ID: %d not supported for Color dimmable Light", message->info.cluster);
}
}

Expand Down
6 changes: 3 additions & 3 deletions libraries/Zigbee/src/ep/ZigbeeLight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ ZigbeeLight::ZigbeeLight(uint8_t endpoint) : ZigbeeEP(endpoint) {
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID, .app_device_version = 0};
}

//set attribude method -> methon overriden in child class
//set attribute method -> method overridden in child class
void ZigbeeLight::zbAttributeSet(const esp_zb_zcl_set_attr_value_message_t *message) {
//check the data and call right method
if (message->info.cluster == ESP_ZB_ZCL_CLUSTER_ID_ON_OFF) {
if (message->attribute.id == ESP_ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID && message->attribute.data.type == ESP_ZB_ZCL_ATTR_TYPE_BOOL) {
_current_state = *(bool *)message->attribute.data.value;
lightChanged();
} else {
log_w("Recieved message ignored. Attribute ID: %d not supported for On/Off Light", message->attribute.id);
log_w("Received message ignored. Attribute ID: %d not supported for On/Off Light", message->attribute.id);
}
} else {
log_w("Recieved message ignored. Cluster ID: %d not supported for On/Off Light", message->info.cluster);
log_w("Received message ignored. Cluster ID: %d not supported for On/Off Light", message->info.cluster);
}
}

Expand Down

0 comments on commit 7d763df

Please sign in to comment.