mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Avoid key_error in modbus climate with non-defined fan_mode. (#110017)
This commit is contained in:
parent
d049928be7
commit
a0abc27612
@ -364,7 +364,9 @@ class ModbusThermostat(BaseStructPlatform, RestoreEntity, ClimateEntity):
|
|||||||
|
|
||||||
# Translate the value received
|
# Translate the value received
|
||||||
if fan_mode is not None:
|
if fan_mode is not None:
|
||||||
self._attr_fan_mode = self._fan_mode_mapping_from_modbus[int(fan_mode)]
|
self._attr_fan_mode = self._fan_mode_mapping_from_modbus.get(
|
||||||
|
int(fan_mode), self._attr_fan_mode
|
||||||
|
)
|
||||||
|
|
||||||
# Read the on/off register if defined. If the value in this
|
# Read the on/off register if defined. If the value in this
|
||||||
# register is "OFF", it will take precedence over the value
|
# register is "OFF", it will take precedence over the value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user