mirror of
https://github.com/home-assistant/core.git
synced 2026-10-06 14:29:21 -04:00
Use typed writes for the Sofar charger mode and remote switch (#183622)
This commit is contained in:
@@ -40,7 +40,9 @@ SELECT_DESCRIPTIONS: tuple[SofarSelectEntityDescription, ...] = (
|
||||
options=_enum_options(ChargerUseMode),
|
||||
options_enum=ChargerUseMode,
|
||||
value_fn=lambda device: device.charger.charger_use_mode,
|
||||
write_fn=lambda device, value: device.charger.write("charger_use_mode", value),
|
||||
write_fn=lambda device, value: device.charger.async_write_mode(
|
||||
ChargerUseMode(value)
|
||||
),
|
||||
),
|
||||
SofarSelectEntityDescription(
|
||||
key="eps_control",
|
||||
|
||||
@@ -31,9 +31,8 @@ SWITCH_DESCRIPTIONS: tuple[SofarSwitchEntityDescription, ...] = (
|
||||
component="remote",
|
||||
name=None,
|
||||
value_fn=lambda device: device.remote.remote_switch_on_off,
|
||||
write_fn=lambda device, value: device.remote.write(
|
||||
"remote_switch_on_off",
|
||||
RemoteSwitchOnOff.ON if value else RemoteSwitchOnOff.OFF,
|
||||
write_fn=lambda device, value: device.remote.async_write_switch(
|
||||
RemoteSwitchOnOff.ON if value else RemoteSwitchOnOff.OFF
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user