mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Fix & update for latest Shelly Valve firmware (#60458)
This commit is contained in:
parent
a29cc29304
commit
110fd261ee
@ -68,13 +68,12 @@ from .utils import (
|
||||
BLOCK_PLATFORMS: Final = [
|
||||
"binary_sensor",
|
||||
"button",
|
||||
"climate",
|
||||
"cover",
|
||||
"light",
|
||||
"sensor",
|
||||
"switch",
|
||||
]
|
||||
BLOCK_SLEEPING_PLATFORMS: Final = ["binary_sensor", "sensor"]
|
||||
BLOCK_SLEEPING_PLATFORMS: Final = ["binary_sensor", "climate", "sensor"]
|
||||
RPC_PLATFORMS: Final = ["binary_sensor", "button", "light", "sensor", "switch"]
|
||||
_LOGGER: Final = logging.getLogger(__name__)
|
||||
|
||||
|
@ -49,6 +49,9 @@ async def async_setup_entry(
|
||||
if get_device_entry_gen(config_entry) == 2:
|
||||
return
|
||||
|
||||
device_block: Block | None = None
|
||||
sensor_block: Block | None = None
|
||||
|
||||
wrapper = hass.data[DOMAIN][DATA_CONFIG_ENTRY][config_entry.entry_id][BLOCK]
|
||||
for block in wrapper.device.blocks:
|
||||
if block.type == "device":
|
||||
@ -176,7 +179,10 @@ class ShellyClimate(ShellyBlockEntity, RestoreEntity, ClimateEntity):
|
||||
return
|
||||
|
||||
preset_index = self._attr_preset_modes.index(preset_mode)
|
||||
await self.set_state_full_path(
|
||||
schedule=(0 if preset_index == 0 else 1),
|
||||
schedule_profile=f"{preset_index}",
|
||||
)
|
||||
|
||||
if preset_index == 0:
|
||||
await self.set_state_full_path(schedule=0)
|
||||
else:
|
||||
await self.set_state_full_path(
|
||||
schedule=1, schedule_profile=f"{preset_index}"
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user