Skip to content

Commit 72cce39

Browse files
authored
Fix some typos found by codespell (esphome#3598)
1 parent 28d2949 commit 72cce39

37 files changed

+67
-67
lines changed

esphome/components/anova/anova.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void Anova::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_
9292
}
9393
if (this->codec_->has_unit()) {
9494
this->fahrenheit_ = (this->codec_->unit_ == 'f');
95-
ESP_LOGD(TAG, "Anova units is %s", this->fahrenheit_ ? "fahrenheit" : "celcius");
95+
ESP_LOGD(TAG, "Anova units is %s", this->fahrenheit_ ? "fahrenheit" : "celsius");
9696
this->current_request_++;
9797
}
9898
this->publish_state();

esphome/components/api/api_frame_helper.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ APIError APINoiseFrameHelper::try_read_frame_(ParsedFrame *frame) {
270270
*
271271
* If the handshake is still active when this method returns and a read/write can't take place at
272272
* the moment, returns WOULD_BLOCK.
273-
* If an error occured, returns that error. Only returns OK if the transport is ready for data
273+
* If an error occurred, returns that error. Only returns OK if the transport is ready for data
274274
* traffic.
275275
*/
276276
APIError APINoiseFrameHelper::state_action_() {
@@ -586,7 +586,7 @@ APIError APINoiseFrameHelper::write_raw_(const struct iovec *iov, int iovcnt) {
586586
}
587587
return APIError::OK;
588588
} else if (sent == -1) {
589-
// an error occured
589+
// an error occurred
590590
state_ = State::FAILED;
591591
HELPER_LOG("Socket write failed with errno %d", errno);
592592
return APIError::SOCKET_WRITE_FAILED;
@@ -980,7 +980,7 @@ APIError APIPlaintextFrameHelper::write_raw_(const struct iovec *iov, int iovcnt
980980
}
981981
return APIError::OK;
982982
} else if (sent == -1) {
983-
// an error occured
983+
// an error occurred
984984
state_ = State::FAILED;
985985
HELPER_LOG("Socket write failed with errno %d", errno);
986986
return APIError::SOCKET_WRITE_FAILED;

esphome/components/bl0939/bl0939.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace bl0939 {
77
static const char *const TAG = "bl0939";
88

99
// https://www.belling.com.cn/media/file_object/bel_product/BL0939/datasheet/BL0939_V1.2_cn.pdf
10-
// (unfortunatelly chinese, but the protocol can be understood with some translation tool)
10+
// (unfortunately chinese, but the protocol can be understood with some translation tool)
1111
static const uint8_t BL0939_READ_COMMAND = 0x55; // 0x5{A4,A3,A2,A1}
1212
static const uint8_t BL0939_FULL_PACKET = 0xAA;
1313
static const uint8_t BL0939_PACKET_HEADER = 0x55;

esphome/components/bl0939/bl0939.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace esphome {
88
namespace bl0939 {
99

1010
// https://datasheet.lcsc.com/lcsc/2108071830_BL-Shanghai-Belling-BL0939_C2841044.pdf
11-
// (unfortunatelly chinese, but the formulas can be easily understood)
11+
// (unfortunately chinese, but the formulas can be easily understood)
1212
// Sonoff Dual R3 V2 has the exact same resistor values for the current shunts (RL=1miliOhm)
1313
// and for the voltage divider (R1=0.51kOhm, R2=5*390kOhm)
1414
// as in the manufacturer's reference circuit, so the same formulas were used here (Vref=1.218V)

esphome/components/current_based/current_based_cover.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void CurrentBasedCover::dump_config() {
131131
ESP_LOGCONFIG(TAG, " Close Duration: %.1fs", this->close_duration_ / 1e3f);
132132
ESP_LOGCONFIG(TAG, "Obstacle Rollback: %.1f%%", this->obstacle_rollback_ * 100);
133133
if (this->max_duration_ != UINT32_MAX) {
134-
ESP_LOGCONFIG(TAG, "Maximun duration: %.1fs", this->max_duration_ / 1e3f);
134+
ESP_LOGCONFIG(TAG, "Maximum duration: %.1fs", this->max_duration_ / 1e3f);
135135
}
136136
ESP_LOGCONFIG(TAG, "Start sensing delay: %.1fs", this->start_sensing_delay_ / 1e3f);
137137
ESP_LOGCONFIG(TAG, "Malfunction detection: %s", YESNO(this->malfunction_detection_));

esphome/components/display/display_color_utils.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class ColorUtil {
132132
int16_t plt_r = (int16_t) palette[i * 3 + 0];
133133
int16_t plt_g = (int16_t) palette[i * 3 + 1];
134134
int16_t plt_b = (int16_t) palette[i * 3 + 2];
135-
// Calculate euclidian distance (linear distance in rgb cube).
135+
// Calculate euclidean distance (linear distance in rgb cube).
136136
x = (uint32_t) std::abs(tgt_r - plt_r);
137137
y = (uint32_t) std::abs(tgt_g - plt_g);
138138
z = (uint32_t) std::abs(tgt_b - plt_b);

esphome/components/dsmr/dsmr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void Dsmr::receive_telegram_() {
171171
this->telegram_[this->bytes_read_] = c;
172172
this->bytes_read_++;
173173

174-
// Check for a footer, i.e. exlamation mark, followed by a hex checksum.
174+
// Check for a footer, i.e. exclamation mark, followed by a hex checksum.
175175
if (c == '!') {
176176
ESP_LOGV(TAG, "Footer of telegram found");
177177
this->footer_found_ = true;

esphome/components/ens210/ens210.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ void ENS210Component::update() {
199199
});
200200
}
201201

202-
// Extracts measurement 'data' and 'status' from a 'val' obtained from measurment.
202+
// Extracts measurement 'data' and 'status' from a 'val' obtained from measurement.
203203
void ENS210Component::extract_measurement_(uint32_t val, int *data, int *status) {
204204
*data = (val >> 0) & 0xffff;
205205
int valid = (val >> 16) & 0x1;

esphome/components/esp32_camera/esp32_camera.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ void ESP32Camera::update_camera_parameters() {
317317
s->set_gainceiling(s, (gainceiling_t) this->agc_gain_ceiling_);
318318
/* update white balance mode */
319319
s->set_wb_mode(s, (int) this->wb_mode_); // 0 to 4
320-
/* update test patern */
320+
/* update test pattern */
321321
s->set_colorbar(s, this->test_pattern_);
322322
}
323323

esphome/components/graph/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def _relocate_fields_to_subfolder(config, subfolder, subschema):
118118
fields = [k.schema for k in subschema.schema.keys()]
119119
fields.remove(CONF_ID)
120120
if subfolder in config:
121-
# Ensure no ambigious fields in base of config
121+
# Ensure no ambiguous fields in base of config
122122
for f in fields:
123123
if f in config:
124124
raise cv.Invalid(

esphome/components/i2c/i2c_bus_arduino.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void ArduinoI2CBus::recover_() {
224224
digitalWrite(sda_pin_, LOW); // NOLINT
225225

226226
// By now, any stuck device ought to have sent all remaining bits of its
227-
// transation, meaning that it should have freed up the SDA line, resulting
227+
// transaction, meaning that it should have freed up the SDA line, resulting
228228
// in SDA being pulled up.
229229
if (digitalRead(sda_pin_) == LOW) { // NOLINT
230230
ESP_LOGE(TAG, "Recovery failed: SDA is held LOW after clock pulse cycle");

esphome/components/i2c/i2c_bus_esp_idf.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ void IDFI2CBus::recover_() {
285285
}
286286

287287
// By now, any stuck device ought to have sent all remaining bits of its
288-
// transation, meaning that it should have freed up the SDA line, resulting
288+
// transaction, meaning that it should have freed up the SDA line, resulting
289289
// in SDA being pulled up.
290290
if (gpio_get_level(sda_pin) == 0) {
291291
ESP_LOGE(TAG, "Recovery failed: SDA is held LOW after clock pulse cycle");

esphome/components/light/light_color_values.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class LightColorValues {
203203
*color_temperature =
204204
(this->color_temperature_ - color_temperature_cw) / (color_temperature_ww - color_temperature_cw);
205205
*white_brightness = gamma_correct(this->state_ * this->brightness_ * white_level, gamma);
206-
} else { // Probably wont get here but put this here anyway.
206+
} else { // Probably won't get here but put this here anyway.
207207
*white_brightness = 0;
208208
}
209209
}

esphome/components/light/light_json_schema.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void LightJSONSchema::parse_color_json(LightState &state, LightCall &call, JsonO
121121
call.set_cold_white(float(color["c"]) / 255.0f);
122122
}
123123
if (color.containsKey("w")) {
124-
// the HA scheme is ambigious here, the same key is used for white channel in RGBW and warm
124+
// the HA scheme is ambiguous here, the same key is used for white channel in RGBW and warm
125125
// white channel in RGBWW.
126126
if (color.containsKey("c")) {
127127
call.set_warm_white(float(color["w"]) / 255.0f);

esphome/components/modbus/modbus.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ bool Modbus::parse_modbus_byte_(uint8_t byte) {
100100
}
101101

102102
// Error ( msb indicates error )
103-
// response format: Byte[0] = device address, Byte[1] function code | 0x80 , Byte[2] excpetion code, Byte[3-4] crc
103+
// response format: Byte[0] = device address, Byte[1] function code | 0x80 , Byte[2] exception code, Byte[3-4] crc
104104
if ((function_code & 0x80) == 0x80) {
105105
data_offset = 2;
106106
data_len = 1;

esphome/components/modbus_controller/modbus_controller.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void ModbusController::on_modbus_error(uint8_t function_code, uint8_t exception_
7070
auto &current_command = this->command_queue_.front();
7171
if (current_command != nullptr) {
7272
ESP_LOGE(TAG,
73-
"Modbus error - last command: function code=0x%X register adddress = 0x%X "
73+
"Modbus error - last command: function code=0x%X register address = 0x%X "
7474
"registers count=%d "
7575
"payload size=%zu",
7676
function_code, current_command->register_address, current_command->register_count,
@@ -105,7 +105,7 @@ void ModbusController::on_register_data(ModbusRegisterType register_type, uint16
105105
}
106106

107107
void ModbusController::queue_command(const ModbusCommandItem &command) {
108-
// check if this commmand is already qeued.
108+
// check if this command is already qeued.
109109
// not very effective but the queue is never really large
110110
for (auto &item : command_queue_) {
111111
if (item->register_address == command.register_address && item->register_count == command.register_count &&
@@ -299,7 +299,7 @@ void ModbusController::loop() {
299299
incoming_queue_.pop();
300300

301301
} else {
302-
// all messages processed send pending commmands
302+
// all messages processed send pending commands
303303
send_next_command_();
304304
}
305305
}

esphome/components/modbus_controller/modbus_controller.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ inline bool coil_from_vector(int coil, const std::vector<uint8_t> &data) {
185185

186186
/** Extract bits from value and shift right according to the bitmask
187187
* if the bitmask is 0x00F0 we want the values frrom bit 5 - 8.
188-
* the result is then shifted right by the postion if the first right set bit in the mask
189-
* Usefull for modbus data where more than one value is packed in a 16 bit register
188+
* the result is then shifted right by the position if the first right set bit in the mask
189+
* Useful for modbus data where more than one value is packed in a 16 bit register
190190
* Example: on Epever the "Length of night" register 0x9065 encodes values of the whole night length of time as
191191
* D15 - D8 = hour, D7 - D0 = minute
192192
* To get the hours use mask 0xFF00 and 0x00FF for the minute
@@ -447,7 +447,7 @@ class ModbusController : public PollingComponent, public modbus::ModbusDevice {
447447
void dump_sensors_();
448448
/// Collection of all sensors for this component
449449
SensorSet sensorset_;
450-
/// Continous range of modbus registers
450+
/// Continuous range of modbus registers
451451
std::vector<RegisterRange> register_ranges_;
452452
/// Hold the pending requests to be sent
453453
std::list<std::unique_ptr<ModbusCommandItem>> command_queue_;

esphome/components/modbus_controller/number/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def validate_modbus_number(config):
6868
),
6969
cv.Optional(CONF_VALUE_TYPE, default="U_WORD"): cv.enum(SENSOR_VALUE_TYPE),
7070
cv.Optional(CONF_WRITE_LAMBDA): cv.returning_lambda,
71-
# 24 bits are the maximum value for fp32 before precison is lost
71+
# 24 bits are the maximum value for fp32 before precision is lost
7272
# 0x00FFFFFF = 16777215
7373
cv.Optional(CONF_MAX_VALUE, default=16777215.0): cv.float_,
7474
cv.Optional(CONF_MIN_VALUE, default=-16777215.0): cv.float_,

esphome/components/nfc/ndef_record.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ NdefRecord::NdefRecord(std::vector<uint8_t> payload_data) {
1212
std::vector<uint8_t> NdefRecord::encode(bool first, bool last) {
1313
std::vector<uint8_t> data;
1414

15-
// Get encoded payload, this is overriden by more specific record classes
15+
// Get encoded payload, this is overridden by more specific record classes
1616
std::vector<uint8_t> payload_data = get_encoded_payload();
1717

1818
size_t payload_length = payload_data.size();

esphome/components/remote_base/nexa_protocol.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ optional<NexaData> NexaProtocol::decode(RemoteReceiveData src) {
106106
SHHHH HHHH HHHH HHHH HHHH HHHH HHGO EE BB DDDD 0 P
107107
108108
S = Sync bit.
109-
H = The first 26 bits are transmitter unique codes, and it is this code that the reciever "learns" to recognize.
109+
H = The first 26 bits are transmitter unique codes, and it is this code that the receiver "learns" to recognize.
110110
G = Group code, set to one for the whole group.
111111
O = On/Off bit. Set to 1 for on, 0 for off.
112112
E = Unit to be turned on or off. The code is inverted, i.e. '11' equals 1, '00' equals 4.

esphome/components/remote_base/rc_switch_protocol.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ bool RCSwitchBase::expect_sync(RemoteReceiveData &src) const {
102102
if (!src.peek_space(this->sync_low_, 1))
103103
return false;
104104
} else {
105-
// We cant peek a space at the beginning because signals starts with a low to high transition.
105+
// We can't peek a space at the beginning because signals starts with a low to high transition.
106106
// this long space at the beginning is the separation between the transmissions itself, so it is actually
107107
// added at the end kind of artificially (by the value given to "idle:" option by the user in the yaml)
108108
if (!src.peek_mark(this->sync_low_))

esphome/components/scd4x/scd4x.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void SCD4XComponent::update() {
205205
bool SCD4XComponent::perform_forced_calibration(uint16_t current_co2_concentration) {
206206
/*
207207
Operate the SCD4x in the operation mode later used in normal sensor operation (periodic measurement, low power
208-
periodic measurement or single shot) for > 3 minutes in an environment with homogenous and constant CO2
208+
periodic measurement or single shot) for > 3 minutes in an environment with homogeneous and constant CO2
209209
concentration before performing a forced recalibration.
210210
*/
211211
if (!this->write_command(SCD4X_CMD_STOP_MEASUREMENTS)) {
@@ -217,7 +217,7 @@ bool SCD4XComponent::perform_forced_calibration(uint16_t current_co2_concentrati
217217
ESP_LOGD(TAG, "setting forced calibration Co2 level %d ppm", current_co2_concentration);
218218
// frc takes 400 ms
219219
// because this method will be used very rarly
220-
// the simple aproach with delay is ok
220+
// the simple approach with delay is ok
221221
delay(400); // NOLINT'
222222
if (!this->start_measurement_()) {
223223
return false;

esphome/components/sensirion_common/i2c_sensirion.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ bool SensirionI2CDevice::read_data(uint16_t *data, uint8_t len) {
3333
}
3434
/***
3535
* write command with parameters and insert crc
36-
* use stack array for less than 4 paramaters. Most sensirion i2c commands have less parameters
36+
* use stack array for less than 4 parameters. Most sensirion i2c commands have less parameters
3737
*/
3838
bool SensirionI2CDevice::write_command_(uint16_t command, CommandLen command_len, const uint16_t *data,
3939
uint8_t data_len) {
@@ -63,7 +63,7 @@ bool SensirionI2CDevice::write_command_(uint16_t command, CommandLen command_len
6363
temp[raw_idx++] = command >> 8;
6464
#endif
6565
}
66-
// add parameters folllowed by crc
66+
// add parameters followed by crc
6767
// skipped if len == 0
6868
for (size_t i = 0; i < data_len; i++) {
6969
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__

esphome/components/sensirion_common/i2c_sensirion.h

+17-17
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ class SensirionI2CDevice : public i2c::I2CDevice {
2020
* handles crc check used by Sensirion sensors
2121
* @param data pointer to raw result
2222
* @param len number of words to read
23-
* @return true if reading succeded
23+
* @return true if reading succeeded
2424
*/
2525
bool read_data(uint16_t *data, uint8_t len);
2626

2727
/** Read 1 data word from i2c device.
2828
* @param data reference to raw result
29-
* @return true if reading succeded
29+
* @return true if reading succeeded
3030
*/
3131
bool read_data(uint16_t &data) { return this->read_data(&data, 1); }
3232

@@ -35,17 +35,17 @@ class SensirionI2CDevice : public i2c::I2CDevice {
3535
* @param i2c register
3636
* @param data pointer to raw result
3737
* @param len number of words to read
38-
* @param delay milliseconds to to wait between sending the i2c commmand and reading the result
39-
* @return true if reading succeded
38+
* @param delay milliseconds to to wait between sending the i2c command and reading the result
39+
* @return true if reading succeeded
4040
*/
4141
bool get_register(uint16_t command, uint16_t *data, uint8_t len, uint8_t delay = 0) {
4242
return get_register_(command, ADDR_16_BIT, data, len, delay);
4343
}
4444
/** Read 1 data word from 16 bit i2c register.
4545
* @param i2c register
4646
* @param data reference to raw result
47-
* @param delay milliseconds to to wait between sending the i2c commmand and reading the result
48-
* @return true if reading succeded
47+
* @param delay milliseconds to to wait between sending the i2c command and reading the result
48+
* @return true if reading succeeded
4949
*/
5050
bool get_register(uint16_t i2c_register, uint16_t &data, uint8_t delay = 0) {
5151
return this->get_register_(i2c_register, ADDR_16_BIT, &data, 1, delay);
@@ -56,8 +56,8 @@ class SensirionI2CDevice : public i2c::I2CDevice {
5656
* @param i2c register
5757
* @param data pointer to raw result
5858
* @param len number of words to read
59-
* @param delay milliseconds to to wait between sending the i2c commmand and reading the result
60-
* @return true if reading succeded
59+
* @param delay milliseconds to to wait between sending the i2c command and reading the result
60+
* @return true if reading succeeded
6161
*/
6262
bool get_8bit_register(uint8_t i2c_register, uint16_t *data, uint8_t len, uint8_t delay = 0) {
6363
return get_register_(i2c_register, ADDR_8_BIT, data, len, delay);
@@ -66,30 +66,30 @@ class SensirionI2CDevice : public i2c::I2CDevice {
6666
/** Read 1 data word from 8 bit i2c register.
6767
* @param i2c register
6868
* @param data reference to raw result
69-
* @param delay milliseconds to to wait between sending the i2c commmand and reading the result
70-
* @return true if reading succeded
69+
* @param delay milliseconds to to wait between sending the i2c command and reading the result
70+
* @return true if reading succeeded
7171
*/
7272
bool get_8bit_register(uint8_t i2c_register, uint16_t &data, uint8_t delay = 0) {
7373
return this->get_register_(i2c_register, ADDR_8_BIT, &data, 1, delay);
7474
}
7575

7676
/** Write a command to the i2c device.
7777
* @param command i2c command to send
78-
* @return true if reading succeded
78+
* @return true if reading succeeded
7979
*/
8080
template<class T> bool write_command(T i2c_register) { return write_command(i2c_register, nullptr, 0); }
8181

8282
/** Write a command and one data word to the i2c device .
8383
* @param command i2c command to send
8484
* @param data argument for the i2c command
85-
* @return true if reading succeded
85+
* @return true if reading succeeded
8686
*/
8787
template<class T> bool write_command(T i2c_register, uint16_t data) { return write_command(i2c_register, &data, 1); }
8888

8989
/** Write a command with arguments as words
9090
* @param i2c_register i2c command to send - an be uint8_t or uint16_t
9191
* @param data vector<uint16> arguments for the i2c command
92-
* @return true if reading succeded
92+
* @return true if reading succeeded
9393
*/
9494
template<class T> bool write_command(T i2c_register, const std::vector<uint16_t> &data) {
9595
return write_command_(i2c_register, sizeof(T), data.data(), data.size());
@@ -99,7 +99,7 @@ class SensirionI2CDevice : public i2c::I2CDevice {
9999
* @param i2c_register i2c command to send - an be uint8_t or uint16_t
100100
* @param data arguments for the i2c command
101101
* @param len number of arguments (words)
102-
* @return true if reading succeded
102+
* @return true if reading succeeded
103103
*/
104104
template<class T> bool write_command(T i2c_register, const uint16_t *data, uint8_t len) {
105105
// limit to 8 or 16 bit only
@@ -115,7 +115,7 @@ class SensirionI2CDevice : public i2c::I2CDevice {
115115
* @param command_len either 1 for short 8 bit command or 2 for 16 bit command codes
116116
* @param data arguments for the i2c command
117117
* @param data_len number of arguments (words)
118-
* @return true if reading succeded
118+
* @return true if reading succeeded
119119
*/
120120
bool write_command_(uint16_t command, CommandLen command_len, const uint16_t *data, uint8_t data_len);
121121

@@ -125,8 +125,8 @@ class SensirionI2CDevice : public i2c::I2CDevice {
125125
* @param command_len either 1 for short 8 bit command or 2 for 16 bit command codes
126126
* @param data pointer to raw result
127127
* @param len number of words to read
128-
* @param delay milliseconds to to wait between sending the i2c commmand and reading the result
129-
* @return true if reading succeded
128+
* @param delay milliseconds to to wait between sending the i2c command and reading the result
129+
* @return true if reading succeeded
130130
*/
131131
bool get_register_(uint16_t reg, CommandLen command_len, uint16_t *data, uint8_t len, uint8_t delay);
132132

0 commit comments

Comments
 (0)