From 72cce391ab9b0afea268ca3f3b419f1f3ffeb6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Klitzing?= Date: Mon, 27 Jun 2022 23:02:46 +0200 Subject: [PATCH] Fix some typos found by codespell (#3598) --- esphome/components/anova/anova.cpp | 2 +- esphome/components/api/api_frame_helper.cpp | 6 ++-- esphome/components/bl0939/bl0939.cpp | 2 +- esphome/components/bl0939/bl0939.h | 2 +- .../current_based/current_based_cover.cpp | 2 +- .../components/display/display_color_utils.h | 2 +- esphome/components/dsmr/dsmr.cpp | 2 +- esphome/components/ens210/ens210.cpp | 2 +- .../components/esp32_camera/esp32_camera.cpp | 2 +- esphome/components/graph/__init__.py | 2 +- esphome/components/i2c/i2c_bus_arduino.cpp | 2 +- esphome/components/i2c/i2c_bus_esp_idf.cpp | 2 +- esphome/components/light/light_color_values.h | 2 +- .../components/light/light_json_schema.cpp | 2 +- esphome/components/modbus/modbus.cpp | 2 +- .../modbus_controller/modbus_controller.cpp | 6 ++-- .../modbus_controller/modbus_controller.h | 6 ++-- .../modbus_controller/number/__init__.py | 2 +- esphome/components/nfc/ndef_record.cpp | 2 +- .../components/remote_base/nexa_protocol.cpp | 2 +- .../remote_base/rc_switch_protocol.cpp | 2 +- esphome/components/scd4x/scd4x.cpp | 4 +-- .../sensirion_common/i2c_sensirion.cpp | 4 +-- .../sensirion_common/i2c_sensirion.h | 34 +++++++++---------- esphome/components/sgp4x/sgp4x.cpp | 10 +++--- .../shelly_dimmer/shelly_dimmer.cpp | 2 +- esphome/components/sonoff_d1/sonoff_d1.cpp | 2 +- .../thermostat/thermostat_climate.h | 2 +- esphome/components/uart/uart_debugger.h | 2 +- .../wifi/wifi_component_esp32_arduino.cpp | 2 +- .../wifi/wifi_component_esp_idf.cpp | 2 +- .../xiaomi_miscale/xiaomi_miscale.cpp | 2 +- esphome/core/__init__.py | 2 +- esphome/core/gpio.h | 2 +- esphome/core/helpers.h | 6 ++-- script/build_language_schema.py | 2 +- script/ci-custom.py | 2 +- 37 files changed, 67 insertions(+), 67 deletions(-) diff --git a/esphome/components/anova/anova.cpp b/esphome/components/anova/anova.cpp index 39b1187caf..6c8316d338 100644 --- a/esphome/components/anova/anova.cpp +++ b/esphome/components/anova/anova.cpp @@ -92,7 +92,7 @@ void Anova::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_ } if (this->codec_->has_unit()) { this->fahrenheit_ = (this->codec_->unit_ == 'f'); - ESP_LOGD(TAG, "Anova units is %s", this->fahrenheit_ ? "fahrenheit" : "celcius"); + ESP_LOGD(TAG, "Anova units is %s", this->fahrenheit_ ? "fahrenheit" : "celsius"); this->current_request_++; } this->publish_state(); diff --git a/esphome/components/api/api_frame_helper.cpp b/esphome/components/api/api_frame_helper.cpp index 9f0ab82a52..b19a55764f 100644 --- a/esphome/components/api/api_frame_helper.cpp +++ b/esphome/components/api/api_frame_helper.cpp @@ -270,7 +270,7 @@ APIError APINoiseFrameHelper::try_read_frame_(ParsedFrame *frame) { * * If the handshake is still active when this method returns and a read/write can't take place at * the moment, returns WOULD_BLOCK. - * If an error occured, returns that error. Only returns OK if the transport is ready for data + * If an error occurred, returns that error. Only returns OK if the transport is ready for data * traffic. */ APIError APINoiseFrameHelper::state_action_() { @@ -586,7 +586,7 @@ APIError APINoiseFrameHelper::write_raw_(const struct iovec *iov, int iovcnt) { } return APIError::OK; } else if (sent == -1) { - // an error occured + // an error occurred state_ = State::FAILED; HELPER_LOG("Socket write failed with errno %d", errno); return APIError::SOCKET_WRITE_FAILED; @@ -980,7 +980,7 @@ APIError APIPlaintextFrameHelper::write_raw_(const struct iovec *iov, int iovcnt } return APIError::OK; } else if (sent == -1) { - // an error occured + // an error occurred state_ = State::FAILED; HELPER_LOG("Socket write failed with errno %d", errno); return APIError::SOCKET_WRITE_FAILED; diff --git a/esphome/components/bl0939/bl0939.cpp b/esphome/components/bl0939/bl0939.cpp index 61d7835a4b..0575507c46 100644 --- a/esphome/components/bl0939/bl0939.cpp +++ b/esphome/components/bl0939/bl0939.cpp @@ -7,7 +7,7 @@ namespace bl0939 { static const char *const TAG = "bl0939"; // https://www.belling.com.cn/media/file_object/bel_product/BL0939/datasheet/BL0939_V1.2_cn.pdf -// (unfortunatelly chinese, but the protocol can be understood with some translation tool) +// (unfortunately chinese, but the protocol can be understood with some translation tool) static const uint8_t BL0939_READ_COMMAND = 0x55; // 0x5{A4,A3,A2,A1} static const uint8_t BL0939_FULL_PACKET = 0xAA; static const uint8_t BL0939_PACKET_HEADER = 0x55; diff --git a/esphome/components/bl0939/bl0939.h b/esphome/components/bl0939/bl0939.h index 5221ae26e7..d3dab67cc1 100644 --- a/esphome/components/bl0939/bl0939.h +++ b/esphome/components/bl0939/bl0939.h @@ -8,7 +8,7 @@ namespace esphome { namespace bl0939 { // https://datasheet.lcsc.com/lcsc/2108071830_BL-Shanghai-Belling-BL0939_C2841044.pdf -// (unfortunatelly chinese, but the formulas can be easily understood) +// (unfortunately chinese, but the formulas can be easily understood) // Sonoff Dual R3 V2 has the exact same resistor values for the current shunts (RL=1miliOhm) // and for the voltage divider (R1=0.51kOhm, R2=5*390kOhm) // as in the manufacturer's reference circuit, so the same formulas were used here (Vref=1.218V) diff --git a/esphome/components/current_based/current_based_cover.cpp b/esphome/components/current_based/current_based_cover.cpp index 9f0a59377d..4a52770bcf 100644 --- a/esphome/components/current_based/current_based_cover.cpp +++ b/esphome/components/current_based/current_based_cover.cpp @@ -131,7 +131,7 @@ void CurrentBasedCover::dump_config() { ESP_LOGCONFIG(TAG, " Close Duration: %.1fs", this->close_duration_ / 1e3f); ESP_LOGCONFIG(TAG, "Obstacle Rollback: %.1f%%", this->obstacle_rollback_ * 100); if (this->max_duration_ != UINT32_MAX) { - ESP_LOGCONFIG(TAG, "Maximun duration: %.1fs", this->max_duration_ / 1e3f); + ESP_LOGCONFIG(TAG, "Maximum duration: %.1fs", this->max_duration_ / 1e3f); } ESP_LOGCONFIG(TAG, "Start sensing delay: %.1fs", this->start_sensing_delay_ / 1e3f); ESP_LOGCONFIG(TAG, "Malfunction detection: %s", YESNO(this->malfunction_detection_)); diff --git a/esphome/components/display/display_color_utils.h b/esphome/components/display/display_color_utils.h index bf6d5445f1..3114dee359 100644 --- a/esphome/components/display/display_color_utils.h +++ b/esphome/components/display/display_color_utils.h @@ -132,7 +132,7 @@ class ColorUtil { int16_t plt_r = (int16_t) palette[i * 3 + 0]; int16_t plt_g = (int16_t) palette[i * 3 + 1]; int16_t plt_b = (int16_t) palette[i * 3 + 2]; - // Calculate euclidian distance (linear distance in rgb cube). + // Calculate euclidean distance (linear distance in rgb cube). x = (uint32_t) std::abs(tgt_r - plt_r); y = (uint32_t) std::abs(tgt_g - plt_g); z = (uint32_t) std::abs(tgt_b - plt_b); diff --git a/esphome/components/dsmr/dsmr.cpp b/esphome/components/dsmr/dsmr.cpp index 7b339e5fe0..f382730912 100644 --- a/esphome/components/dsmr/dsmr.cpp +++ b/esphome/components/dsmr/dsmr.cpp @@ -171,7 +171,7 @@ void Dsmr::receive_telegram_() { this->telegram_[this->bytes_read_] = c; this->bytes_read_++; - // Check for a footer, i.e. exlamation mark, followed by a hex checksum. + // Check for a footer, i.e. exclamation mark, followed by a hex checksum. if (c == '!') { ESP_LOGV(TAG, "Footer of telegram found"); this->footer_found_ = true; diff --git a/esphome/components/ens210/ens210.cpp b/esphome/components/ens210/ens210.cpp index 9a89e85da2..a9c519856b 100644 --- a/esphome/components/ens210/ens210.cpp +++ b/esphome/components/ens210/ens210.cpp @@ -199,7 +199,7 @@ void ENS210Component::update() { }); } -// Extracts measurement 'data' and 'status' from a 'val' obtained from measurment. +// Extracts measurement 'data' and 'status' from a 'val' obtained from measurement. void ENS210Component::extract_measurement_(uint32_t val, int *data, int *status) { *data = (val >> 0) & 0xffff; int valid = (val >> 16) & 0x1; diff --git a/esphome/components/esp32_camera/esp32_camera.cpp b/esphome/components/esp32_camera/esp32_camera.cpp index 165c00c960..7e23c9dc6e 100644 --- a/esphome/components/esp32_camera/esp32_camera.cpp +++ b/esphome/components/esp32_camera/esp32_camera.cpp @@ -317,7 +317,7 @@ void ESP32Camera::update_camera_parameters() { s->set_gainceiling(s, (gainceiling_t) this->agc_gain_ceiling_); /* update white balance mode */ s->set_wb_mode(s, (int) this->wb_mode_); // 0 to 4 - /* update test patern */ + /* update test pattern */ s->set_colorbar(s, this->test_pattern_); } diff --git a/esphome/components/graph/__init__.py b/esphome/components/graph/__init__.py index 12acfee869..046f59ca1a 100644 --- a/esphome/components/graph/__init__.py +++ b/esphome/components/graph/__init__.py @@ -118,7 +118,7 @@ def _relocate_fields_to_subfolder(config, subfolder, subschema): fields = [k.schema for k in subschema.schema.keys()] fields.remove(CONF_ID) if subfolder in config: - # Ensure no ambigious fields in base of config + # Ensure no ambiguous fields in base of config for f in fields: if f in config: raise cv.Invalid( diff --git a/esphome/components/i2c/i2c_bus_arduino.cpp b/esphome/components/i2c/i2c_bus_arduino.cpp index cfdf818112..2e92468659 100644 --- a/esphome/components/i2c/i2c_bus_arduino.cpp +++ b/esphome/components/i2c/i2c_bus_arduino.cpp @@ -224,7 +224,7 @@ void ArduinoI2CBus::recover_() { digitalWrite(sda_pin_, LOW); // NOLINT // By now, any stuck device ought to have sent all remaining bits of its - // transation, meaning that it should have freed up the SDA line, resulting + // transaction, meaning that it should have freed up the SDA line, resulting // in SDA being pulled up. if (digitalRead(sda_pin_) == LOW) { // NOLINT ESP_LOGE(TAG, "Recovery failed: SDA is held LOW after clock pulse cycle"); diff --git a/esphome/components/i2c/i2c_bus_esp_idf.cpp b/esphome/components/i2c/i2c_bus_esp_idf.cpp index 160b1b96d8..1e2a7304f2 100644 --- a/esphome/components/i2c/i2c_bus_esp_idf.cpp +++ b/esphome/components/i2c/i2c_bus_esp_idf.cpp @@ -285,7 +285,7 @@ void IDFI2CBus::recover_() { } // By now, any stuck device ought to have sent all remaining bits of its - // transation, meaning that it should have freed up the SDA line, resulting + // transaction, meaning that it should have freed up the SDA line, resulting // in SDA being pulled up. if (gpio_get_level(sda_pin) == 0) { ESP_LOGE(TAG, "Recovery failed: SDA is held LOW after clock pulse cycle"); diff --git a/esphome/components/light/light_color_values.h b/esphome/components/light/light_color_values.h index ffbe378ee3..10a3c2f335 100644 --- a/esphome/components/light/light_color_values.h +++ b/esphome/components/light/light_color_values.h @@ -203,7 +203,7 @@ class LightColorValues { *color_temperature = (this->color_temperature_ - color_temperature_cw) / (color_temperature_ww - color_temperature_cw); *white_brightness = gamma_correct(this->state_ * this->brightness_ * white_level, gamma); - } else { // Probably wont get here but put this here anyway. + } else { // Probably won't get here but put this here anyway. *white_brightness = 0; } } diff --git a/esphome/components/light/light_json_schema.cpp b/esphome/components/light/light_json_schema.cpp index c126859076..6f8cc11f25 100644 --- a/esphome/components/light/light_json_schema.cpp +++ b/esphome/components/light/light_json_schema.cpp @@ -121,7 +121,7 @@ void LightJSONSchema::parse_color_json(LightState &state, LightCall &call, JsonO call.set_cold_white(float(color["c"]) / 255.0f); } if (color.containsKey("w")) { - // the HA scheme is ambigious here, the same key is used for white channel in RGBW and warm + // the HA scheme is ambiguous here, the same key is used for white channel in RGBW and warm // white channel in RGBWW. if (color.containsKey("c")) { call.set_warm_white(float(color["w"]) / 255.0f); diff --git a/esphome/components/modbus/modbus.cpp b/esphome/components/modbus/modbus.cpp index 0928b0f6f3..845fa92e95 100644 --- a/esphome/components/modbus/modbus.cpp +++ b/esphome/components/modbus/modbus.cpp @@ -100,7 +100,7 @@ bool Modbus::parse_modbus_byte_(uint8_t byte) { } // Error ( msb indicates error ) - // response format: Byte[0] = device address, Byte[1] function code | 0x80 , Byte[2] excpetion code, Byte[3-4] crc + // response format: Byte[0] = device address, Byte[1] function code | 0x80 , Byte[2] exception code, Byte[3-4] crc if ((function_code & 0x80) == 0x80) { data_offset = 2; data_len = 1; diff --git a/esphome/components/modbus_controller/modbus_controller.cpp b/esphome/components/modbus_controller/modbus_controller.cpp index 91e0dcc45f..993bdaa38f 100644 --- a/esphome/components/modbus_controller/modbus_controller.cpp +++ b/esphome/components/modbus_controller/modbus_controller.cpp @@ -70,7 +70,7 @@ void ModbusController::on_modbus_error(uint8_t function_code, uint8_t exception_ auto ¤t_command = this->command_queue_.front(); if (current_command != nullptr) { ESP_LOGE(TAG, - "Modbus error - last command: function code=0x%X register adddress = 0x%X " + "Modbus error - last command: function code=0x%X register address = 0x%X " "registers count=%d " "payload size=%zu", function_code, current_command->register_address, current_command->register_count, @@ -105,7 +105,7 @@ void ModbusController::on_register_data(ModbusRegisterType register_type, uint16 } void ModbusController::queue_command(const ModbusCommandItem &command) { - // check if this commmand is already qeued. + // check if this command is already qeued. // not very effective but the queue is never really large for (auto &item : command_queue_) { if (item->register_address == command.register_address && item->register_count == command.register_count && @@ -299,7 +299,7 @@ void ModbusController::loop() { incoming_queue_.pop(); } else { - // all messages processed send pending commmands + // all messages processed send pending commands send_next_command_(); } } diff --git a/esphome/components/modbus_controller/modbus_controller.h b/esphome/components/modbus_controller/modbus_controller.h index 6aecf7f8a4..8faad376da 100644 --- a/esphome/components/modbus_controller/modbus_controller.h +++ b/esphome/components/modbus_controller/modbus_controller.h @@ -185,8 +185,8 @@ inline bool coil_from_vector(int coil, const std::vector &data) { /** Extract bits from value and shift right according to the bitmask * if the bitmask is 0x00F0 we want the values frrom bit 5 - 8. - * the result is then shifted right by the postion if the first right set bit in the mask - * Usefull for modbus data where more than one value is packed in a 16 bit register + * the result is then shifted right by the position if the first right set bit in the mask + * Useful for modbus data where more than one value is packed in a 16 bit register * Example: on Epever the "Length of night" register 0x9065 encodes values of the whole night length of time as * D15 - D8 = hour, D7 - D0 = minute * To get the hours use mask 0xFF00 and 0x00FF for the minute @@ -447,7 +447,7 @@ class ModbusController : public PollingComponent, public modbus::ModbusDevice { void dump_sensors_(); /// Collection of all sensors for this component SensorSet sensorset_; - /// Continous range of modbus registers + /// Continuous range of modbus registers std::vector register_ranges_; /// Hold the pending requests to be sent std::list> command_queue_; diff --git a/esphome/components/modbus_controller/number/__init__.py b/esphome/components/modbus_controller/number/__init__.py index 37a39ff334..52f63e791b 100644 --- a/esphome/components/modbus_controller/number/__init__.py +++ b/esphome/components/modbus_controller/number/__init__.py @@ -68,7 +68,7 @@ CONFIG_SCHEMA = cv.All( ), cv.Optional(CONF_VALUE_TYPE, default="U_WORD"): cv.enum(SENSOR_VALUE_TYPE), cv.Optional(CONF_WRITE_LAMBDA): cv.returning_lambda, - # 24 bits are the maximum value for fp32 before precison is lost + # 24 bits are the maximum value for fp32 before precision is lost # 0x00FFFFFF = 16777215 cv.Optional(CONF_MAX_VALUE, default=16777215.0): cv.float_, cv.Optional(CONF_MIN_VALUE, default=-16777215.0): cv.float_, diff --git a/esphome/components/nfc/ndef_record.cpp b/esphome/components/nfc/ndef_record.cpp index 8a3a7d375d..8eb0c3b901 100644 --- a/esphome/components/nfc/ndef_record.cpp +++ b/esphome/components/nfc/ndef_record.cpp @@ -12,7 +12,7 @@ NdefRecord::NdefRecord(std::vector payload_data) { std::vector NdefRecord::encode(bool first, bool last) { std::vector data; - // Get encoded payload, this is overriden by more specific record classes + // Get encoded payload, this is overridden by more specific record classes std::vector payload_data = get_encoded_payload(); size_t payload_length = payload_data.size(); diff --git a/esphome/components/remote_base/nexa_protocol.cpp b/esphome/components/remote_base/nexa_protocol.cpp index dbdc835fe3..a0066ea5d4 100644 --- a/esphome/components/remote_base/nexa_protocol.cpp +++ b/esphome/components/remote_base/nexa_protocol.cpp @@ -106,7 +106,7 @@ optional NexaProtocol::decode(RemoteReceiveData src) { SHHHH HHHH HHHH HHHH HHHH HHHH HHGO EE BB DDDD 0 P S = Sync bit. - H = The first 26 bits are transmitter unique codes, and it is this code that the reciever "learns" to recognize. + H = The first 26 bits are transmitter unique codes, and it is this code that the receiver "learns" to recognize. G = Group code, set to one for the whole group. O = On/Off bit. Set to 1 for on, 0 for off. E = Unit to be turned on or off. The code is inverted, i.e. '11' equals 1, '00' equals 4. diff --git a/esphome/components/remote_base/rc_switch_protocol.cpp b/esphome/components/remote_base/rc_switch_protocol.cpp index b353f0254e..5b6284a86f 100644 --- a/esphome/components/remote_base/rc_switch_protocol.cpp +++ b/esphome/components/remote_base/rc_switch_protocol.cpp @@ -102,7 +102,7 @@ bool RCSwitchBase::expect_sync(RemoteReceiveData &src) const { if (!src.peek_space(this->sync_low_, 1)) return false; } else { - // We cant peek a space at the beginning because signals starts with a low to high transition. + // We can't peek a space at the beginning because signals starts with a low to high transition. // this long space at the beginning is the separation between the transmissions itself, so it is actually // added at the end kind of artificially (by the value given to "idle:" option by the user in the yaml) if (!src.peek_mark(this->sync_low_)) diff --git a/esphome/components/scd4x/scd4x.cpp b/esphome/components/scd4x/scd4x.cpp index cbda996a4c..681324fa18 100644 --- a/esphome/components/scd4x/scd4x.cpp +++ b/esphome/components/scd4x/scd4x.cpp @@ -205,7 +205,7 @@ void SCD4XComponent::update() { bool SCD4XComponent::perform_forced_calibration(uint16_t current_co2_concentration) { /* Operate the SCD4x in the operation mode later used in normal sensor operation (periodic measurement, low power - periodic measurement or single shot) for > 3 minutes in an environment with homogenous and constant CO2 + periodic measurement or single shot) for > 3 minutes in an environment with homogeneous and constant CO2 concentration before performing a forced recalibration. */ if (!this->write_command(SCD4X_CMD_STOP_MEASUREMENTS)) { @@ -217,7 +217,7 @@ bool SCD4XComponent::perform_forced_calibration(uint16_t current_co2_concentrati ESP_LOGD(TAG, "setting forced calibration Co2 level %d ppm", current_co2_concentration); // frc takes 400 ms // because this method will be used very rarly - // the simple aproach with delay is ok + // the simple approach with delay is ok delay(400); // NOLINT' if (!this->start_measurement_()) { return false; diff --git a/esphome/components/sensirion_common/i2c_sensirion.cpp b/esphome/components/sensirion_common/i2c_sensirion.cpp index a2232a7d1b..d8ab817a73 100644 --- a/esphome/components/sensirion_common/i2c_sensirion.cpp +++ b/esphome/components/sensirion_common/i2c_sensirion.cpp @@ -33,7 +33,7 @@ bool SensirionI2CDevice::read_data(uint16_t *data, uint8_t len) { } /*** * write command with parameters and insert crc - * use stack array for less than 4 paramaters. Most sensirion i2c commands have less parameters + * use stack array for less than 4 parameters. Most sensirion i2c commands have less parameters */ bool SensirionI2CDevice::write_command_(uint16_t command, CommandLen command_len, const uint16_t *data, uint8_t data_len) { @@ -63,7 +63,7 @@ bool SensirionI2CDevice::write_command_(uint16_t command, CommandLen command_len temp[raw_idx++] = command >> 8; #endif } - // add parameters folllowed by crc + // add parameters followed by crc // skipped if len == 0 for (size_t i = 0; i < data_len; i++) { #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ diff --git a/esphome/components/sensirion_common/i2c_sensirion.h b/esphome/components/sensirion_common/i2c_sensirion.h index 88e1d59984..3f0282a5d4 100644 --- a/esphome/components/sensirion_common/i2c_sensirion.h +++ b/esphome/components/sensirion_common/i2c_sensirion.h @@ -20,13 +20,13 @@ class SensirionI2CDevice : public i2c::I2CDevice { * handles crc check used by Sensirion sensors * @param data pointer to raw result * @param len number of words to read - * @return true if reading succeded + * @return true if reading succeeded */ bool read_data(uint16_t *data, uint8_t len); /** Read 1 data word from i2c device. * @param data reference to raw result - * @return true if reading succeded + * @return true if reading succeeded */ bool read_data(uint16_t &data) { return this->read_data(&data, 1); } @@ -35,8 +35,8 @@ class SensirionI2CDevice : public i2c::I2CDevice { * @param i2c register * @param data pointer to raw result * @param len number of words to read - * @param delay milliseconds to to wait between sending the i2c commmand and reading the result - * @return true if reading succeded + * @param delay milliseconds to to wait between sending the i2c command and reading the result + * @return true if reading succeeded */ bool get_register(uint16_t command, uint16_t *data, uint8_t len, uint8_t delay = 0) { return get_register_(command, ADDR_16_BIT, data, len, delay); @@ -44,8 +44,8 @@ class SensirionI2CDevice : public i2c::I2CDevice { /** Read 1 data word from 16 bit i2c register. * @param i2c register * @param data reference to raw result - * @param delay milliseconds to to wait between sending the i2c commmand and reading the result - * @return true if reading succeded + * @param delay milliseconds to to wait between sending the i2c command and reading the result + * @return true if reading succeeded */ bool get_register(uint16_t i2c_register, uint16_t &data, uint8_t delay = 0) { return this->get_register_(i2c_register, ADDR_16_BIT, &data, 1, delay); @@ -56,8 +56,8 @@ class SensirionI2CDevice : public i2c::I2CDevice { * @param i2c register * @param data pointer to raw result * @param len number of words to read - * @param delay milliseconds to to wait between sending the i2c commmand and reading the result - * @return true if reading succeded + * @param delay milliseconds to to wait between sending the i2c command and reading the result + * @return true if reading succeeded */ bool get_8bit_register(uint8_t i2c_register, uint16_t *data, uint8_t len, uint8_t delay = 0) { return get_register_(i2c_register, ADDR_8_BIT, data, len, delay); @@ -66,8 +66,8 @@ class SensirionI2CDevice : public i2c::I2CDevice { /** Read 1 data word from 8 bit i2c register. * @param i2c register * @param data reference to raw result - * @param delay milliseconds to to wait between sending the i2c commmand and reading the result - * @return true if reading succeded + * @param delay milliseconds to to wait between sending the i2c command and reading the result + * @return true if reading succeeded */ bool get_8bit_register(uint8_t i2c_register, uint16_t &data, uint8_t delay = 0) { return this->get_register_(i2c_register, ADDR_8_BIT, &data, 1, delay); @@ -75,21 +75,21 @@ class SensirionI2CDevice : public i2c::I2CDevice { /** Write a command to the i2c device. * @param command i2c command to send - * @return true if reading succeded + * @return true if reading succeeded */ template bool write_command(T i2c_register) { return write_command(i2c_register, nullptr, 0); } /** Write a command and one data word to the i2c device . * @param command i2c command to send * @param data argument for the i2c command - * @return true if reading succeded + * @return true if reading succeeded */ template bool write_command(T i2c_register, uint16_t data) { return write_command(i2c_register, &data, 1); } /** Write a command with arguments as words * @param i2c_register i2c command to send - an be uint8_t or uint16_t * @param data vector arguments for the i2c command - * @return true if reading succeded + * @return true if reading succeeded */ template bool write_command(T i2c_register, const std::vector &data) { return write_command_(i2c_register, sizeof(T), data.data(), data.size()); @@ -99,7 +99,7 @@ class SensirionI2CDevice : public i2c::I2CDevice { * @param i2c_register i2c command to send - an be uint8_t or uint16_t * @param data arguments for the i2c command * @param len number of arguments (words) - * @return true if reading succeded + * @return true if reading succeeded */ template bool write_command(T i2c_register, const uint16_t *data, uint8_t len) { // limit to 8 or 16 bit only @@ -115,7 +115,7 @@ class SensirionI2CDevice : public i2c::I2CDevice { * @param command_len either 1 for short 8 bit command or 2 for 16 bit command codes * @param data arguments for the i2c command * @param data_len number of arguments (words) - * @return true if reading succeded + * @return true if reading succeeded */ bool write_command_(uint16_t command, CommandLen command_len, const uint16_t *data, uint8_t data_len); @@ -125,8 +125,8 @@ class SensirionI2CDevice : public i2c::I2CDevice { * @param command_len either 1 for short 8 bit command or 2 for 16 bit command codes * @param data pointer to raw result * @param len number of words to read - * @param delay milliseconds to to wait between sending the i2c commmand and reading the result - * @return true if reading succeded + * @param delay milliseconds to to wait between sending the i2c command and reading the result + * @return true if reading succeeded */ bool get_register_(uint16_t reg, CommandLen command_len, uint16_t *data, uint8_t len, uint8_t delay); diff --git a/esphome/components/sgp4x/sgp4x.cpp b/esphome/components/sgp4x/sgp4x.cpp index 257c30075f..7fe46b9518 100644 --- a/esphome/components/sgp4x/sgp4x.cpp +++ b/esphome/components/sgp4x/sgp4x.cpp @@ -39,7 +39,7 @@ void SGP4xComponent::setup() { ESP_LOGE(TAG, "Measuring NOx requires a SGP41 sensor but a SGP40 sensor is detected"); // disable the sensor this->nox_sensor_->set_disabled_by_default(true); - // make sure it's not visiable in HA + // make sure it's not visible in HA this->nox_sensor_->set_internal(true); this->nox_sensor_->state = NAN; // remove pointer to sensor @@ -104,8 +104,8 @@ void SGP4xComponent::setup() { https://github.com/Sensirion/embedded-sgp/issues/136 indicate the algorithm should be a bit resilient to slight timing variations so the software timer should be accurate enough for this. - This block starts sampling from the sensor at 1Hz, and is done seperately from the call - to the update method. This seperation is to support getting accurate measurements but + This block starts sampling from the sensor at 1Hz, and is done separately from the call + to the update method. This separation is to support getting accurate measurements but limit the amount of communication done over wifi for power consumption or to keep the number of records reported from being overwhelming. */ @@ -236,9 +236,9 @@ bool SGP4xComponent::measure_raw_(uint16_t &voc_raw, uint16_t &nox_raw) { } uint16_t rhticks = llround((uint16_t)((humidity * 65535) / 100)); uint16_t tempticks = (uint16_t)(((temperature + 45) * 65535) / 175); - // first paramater are the relative humidity ticks + // first parameter are the relative humidity ticks data[0] = rhticks; - // secomd paramater are the temperature ticks + // secomd parameter are the temperature ticks data[1] = tempticks; if (!this->write_command(command, data, 2)) { diff --git a/esphome/components/shelly_dimmer/shelly_dimmer.cpp b/esphome/components/shelly_dimmer/shelly_dimmer.cpp index 32c556da5e..94fe836742 100644 --- a/esphome/components/shelly_dimmer/shelly_dimmer.cpp +++ b/esphome/components/shelly_dimmer/shelly_dimmer.cpp @@ -49,7 +49,7 @@ constexpr float POWER_SCALING_FACTOR = 880373; constexpr float VOLTAGE_SCALING_FACTOR = 347800; constexpr float CURRENT_SCALING_FACTOR = 1448; -// Esentially std::size() for pre c++17 +// Essentially std::size() for pre c++17 template constexpr size_t size(const T (&/*unused*/)[N]) noexcept { return N; } } // Anonymous namespace diff --git a/esphome/components/sonoff_d1/sonoff_d1.cpp b/esphome/components/sonoff_d1/sonoff_d1.cpp index d07f9229b6..dc6b719f1b 100644 --- a/esphome/components/sonoff_d1/sonoff_d1.cpp +++ b/esphome/components/sonoff_d1/sonoff_d1.cpp @@ -161,7 +161,7 @@ bool SonoffD1Output::write_command_(uint8_t *cmd, const size_t len, bool needs_a return false; } if ((cmd[5] + 7 /*mandatory header + suffix length*/) != len) { - ESP_LOGW(TAG, "[%04d] Payload length field does not match packet lenght (%d, expected %d)", this->write_count_, + ESP_LOGW(TAG, "[%04d] Payload length field does not match packet length (%d, expected %d)", this->write_count_, cmd[5], len - 7); return false; } diff --git a/esphome/components/thermostat/thermostat_climate.h b/esphome/components/thermostat/thermostat_climate.h index c9231370ba..a5498dc53d 100644 --- a/esphome/components/thermostat/thermostat_climate.h +++ b/esphome/components/thermostat/thermostat_climate.h @@ -163,7 +163,7 @@ class ThermostatClimate : public climate::Climate, public Component { /// Change to a provided custom preset setting; will reset temperature, mode, fan, and swing modes accordingly void change_custom_preset_(const std::string &custom_preset); - /// Applies the temperature, mode, fan, and swing modes of the provded config. + /// Applies the temperature, mode, fan, and swing modes of the provided config. /// This is agnostic of custom vs built in preset void change_preset_internal_(const ThermostatClimateTargetTempConfig &config); diff --git a/esphome/components/uart/uart_debugger.h b/esphome/components/uart/uart_debugger.h index 6e84bbe450..4f9b6d09df 100644 --- a/esphome/components/uart/uart_debugger.h +++ b/esphome/components/uart/uart_debugger.h @@ -38,7 +38,7 @@ class UARTDebugger : public Component, public Triggerafter_delimiter_.push_back(byte); } diff --git a/esphome/components/wifi/wifi_component_esp32_arduino.cpp b/esphome/components/wifi/wifi_component_esp32_arduino.cpp index 83381f3424..e893712287 100644 --- a/esphome/components/wifi/wifi_component_esp32_arduino.cpp +++ b/esphome/components/wifi/wifi_component_esp32_arduino.cpp @@ -195,7 +195,7 @@ bool WiFiComponent::wifi_sta_connect_(const WiFiAP &ap) { #if ESP_IDF_VERSION_MAJOR >= 4 // Protected Management Frame - // Device will prefer to connect in PMF mode if other device also advertizes PMF capability. + // Device will prefer to connect in PMF mode if other device also advertises PMF capability. conf.sta.pmf_cfg.capable = true; conf.sta.pmf_cfg.required = false; #endif diff --git a/esphome/components/wifi/wifi_component_esp_idf.cpp b/esphome/components/wifi/wifi_component_esp_idf.cpp index b838e42b0d..6d20219c69 100644 --- a/esphome/components/wifi/wifi_component_esp_idf.cpp +++ b/esphome/components/wifi/wifi_component_esp_idf.cpp @@ -303,7 +303,7 @@ bool WiFiComponent::wifi_sta_connect_(const WiFiAP &ap) { #if ESP_IDF_VERSION_MAJOR >= 4 // Protected Management Frame - // Device will prefer to connect in PMF mode if other device also advertizes PMF capability. + // Device will prefer to connect in PMF mode if other device also advertises PMF capability. conf.sta.pmf_cfg.capable = true; conf.sta.pmf_cfg.required = false; #endif diff --git a/esphome/components/xiaomi_miscale/xiaomi_miscale.cpp b/esphome/components/xiaomi_miscale/xiaomi_miscale.cpp index 4ed5f587de..29c9de1652 100644 --- a/esphome/components/xiaomi_miscale/xiaomi_miscale.cpp +++ b/esphome/components/xiaomi_miscale/xiaomi_miscale.cpp @@ -38,7 +38,7 @@ bool XiaomiMiscale::parse_device(const esp32_ble_tracker::ESPBTDevice &device) { if (this->impedance_ != nullptr) { if (res->version == 1) { - ESP_LOGW(TAG, "Impedance is only supported on version 2. Your scale was identified as verison 1."); + ESP_LOGW(TAG, "Impedance is only supported on version 2. Your scale was identified as version 1."); } else { if (res->impedance.has_value()) { this->impedance_->publish_state(*res->impedance); diff --git a/esphome/core/__init__.py b/esphome/core/__init__.py index a4867915bb..2c91bb4c9c 100644 --- a/esphome/core/__init__.py +++ b/esphome/core/__init__.py @@ -651,7 +651,7 @@ class EsphomeCore: continue if other.repository is not None: if library.repository is None or other.repository == library.repository: - # Other is using a/the same repository, takes precendence + # Other is using a/the same repository, takes precedence break raise ValueError( f"Adding named Library with repository failed! Libraries {library} and {other} " diff --git a/esphome/core/gpio.h b/esphome/core/gpio.h index 04658d567c..b953a95664 100644 --- a/esphome/core/gpio.h +++ b/esphome/core/gpio.h @@ -9,7 +9,7 @@ namespace esphome { ESP_LOGCONFIG(TAG, prefix "%s", (pin)->dump_summary().c_str()); \ } -// put GPIO flags in a namepsace to not pollute esphome namespace +// put GPIO flags in a namespace to not pollute esphome namespace namespace gpio { enum Flags : uint8_t { diff --git a/esphome/core/helpers.h b/esphome/core/helpers.h index 8c723a04cb..dab829ab93 100644 --- a/esphome/core/helpers.h +++ b/esphome/core/helpers.h @@ -258,10 +258,10 @@ inline std::string to_string(const std::string &val) { return val; } /// Truncate a string to a specific length. std::string str_truncate(const std::string &str, size_t length); -/// Extract the part of the string until either the first occurence of the specified character, or the end (requires str -/// to be null-terminated). +/// Extract the part of the string until either the first occurrence of the specified character, or the end +/// (requires str to be null-terminated). std::string str_until(const char *str, char ch); -/// Extract the part of the string until either the first occurence of the specified character, or the end. +/// Extract the part of the string until either the first occurrence of the specified character, or the end. std::string str_until(const std::string &str, char ch); /// Convert the string to lower case. diff --git a/script/build_language_schema.py b/script/build_language_schema.py index 89f8d52ea9..0b3cdf976d 100644 --- a/script/build_language_schema.py +++ b/script/build_language_schema.py @@ -13,7 +13,7 @@ import esphome.schema_extractors as ejs ejs.EnableSchemaExtraction = True # schema format: -# Schemas are splitted in several files in json format, one for core stuff, one for each platform (sensor, binary_sensor, etc) and +# Schemas are split in several files in json format, one for core stuff, one for each platform (sensor, binary_sensor, etc) and # one for each component (dallas, sim800l, etc.) component can have schema for root component/hub and also for platform component, # e.g. dallas has hub component which has pin and then has the sensor platform which has sensor name, index, etc. # When files are loaded they are merged in a single object. diff --git a/script/ci-custom.py b/script/ci-custom.py index c0737da103..6f69b55d2c 100755 --- a/script/ci-custom.py +++ b/script/ci-custom.py @@ -452,7 +452,7 @@ def lint_no_removed_in_idf_conversions(fname, match): replacement = IDF_CONVERSION_FORBIDDEN[match.group(1)] return ( f"The macro {highlight(match.group(1))} can no longer be used in ESPHome directly. " - f"Plese use {highlight(replacement)} instead." + f"Please use {highlight(replacement)} instead." )