Merge pull request #3111 from esphome/bump-2022.1.2

2022.1.2
This commit is contained in:
Jesse Hills 2022-01-25 09:36:20 +13:00 committed by GitHub
commit 5bbee1a1fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -57,9 +57,11 @@ void ModbusNumber::control(float value) {
// Create and send the write command
ModbusCommandItem write_cmd;
if (this->register_count == 1 && !this->use_write_multiple_) {
write_cmd = ModbusCommandItem::create_write_single_command(parent_, this->start_address + this->offset, data[0]);
// since offset is in bytes and a register is 16 bits we get the start by adding offset/2
write_cmd =
ModbusCommandItem::create_write_single_command(parent_, this->start_address + this->offset / 2, data[0]);
} else {
write_cmd = ModbusCommandItem::create_write_multiple_command(parent_, this->start_address + this->offset,
write_cmd = ModbusCommandItem::create_write_multiple_command(parent_, this->start_address + this->offset / 2,
this->register_count, data);
}
// publish new value

View file

@ -104,7 +104,6 @@ async def to_code(config):
)
light_state = cg.new_Pvariable(conf[CONF_LIGHT_ID], "", wrapper)
await cg.register_component(light_state, conf)
cg.add(cg.App.register_light(light_state))
segments.append(AddressableSegment(light_state, 0, 1, False))
else:

View file

@ -1,6 +1,6 @@
"""Constants used by esphome."""
__version__ = "2022.1.1"
__version__ = "2022.1.2"
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"