mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +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 = [
|
BLOCK_PLATFORMS: Final = [
|
||||||
"binary_sensor",
|
"binary_sensor",
|
||||||
"button",
|
"button",
|
||||||
"climate",
|
|
||||||
"cover",
|
"cover",
|
||||||
"light",
|
"light",
|
||||||
"sensor",
|
"sensor",
|
||||||
"switch",
|
"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"]
|
RPC_PLATFORMS: Final = ["binary_sensor", "button", "light", "sensor", "switch"]
|
||||||
_LOGGER: Final = logging.getLogger(__name__)
|
_LOGGER: Final = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -49,6 +49,9 @@ async def async_setup_entry(
|
|||||||
if get_device_entry_gen(config_entry) == 2:
|
if get_device_entry_gen(config_entry) == 2:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
device_block: Block | None = None
|
||||||
|
sensor_block: Block | None = None
|
||||||
|
|
||||||
wrapper = hass.data[DOMAIN][DATA_CONFIG_ENTRY][config_entry.entry_id][BLOCK]
|
wrapper = hass.data[DOMAIN][DATA_CONFIG_ENTRY][config_entry.entry_id][BLOCK]
|
||||||
for block in wrapper.device.blocks:
|
for block in wrapper.device.blocks:
|
||||||
if block.type == "device":
|
if block.type == "device":
|
||||||
@ -176,7 +179,10 @@ class ShellyClimate(ShellyBlockEntity, RestoreEntity, ClimateEntity):
|
|||||||
return
|
return
|
||||||
|
|
||||||
preset_index = self._attr_preset_modes.index(preset_mode)
|
preset_index = self._attr_preset_modes.index(preset_mode)
|
||||||
await self.set_state_full_path(
|
|
||||||
schedule=(0 if preset_index == 0 else 1),
|
if preset_index == 0:
|
||||||
schedule_profile=f"{preset_index}",
|
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