mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Revert "Add silent option for DynamicShutter (ogp:Shutter) in Overkiz" (#91354)
This commit is contained in:
parent
a48a07bd8d
commit
0e0ab4427b
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Any, cast
|
from typing import Any
|
||||||
|
|
||||||
from pyoverkiz.enums import OverkizCommand, OverkizCommandParam, OverkizState
|
from pyoverkiz.enums import OverkizCommand, OverkizCommandParam, OverkizState
|
||||||
from pyoverkiz.enums.ui import UIClass, UIWidget
|
from pyoverkiz.enums.ui import UIClass, UIWidget
|
||||||
@ -15,12 +15,12 @@ from homeassistant.components.switch import (
|
|||||||
SwitchEntityDescription,
|
SwitchEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import EntityCategory
|
from homeassistant.const import EntityCategory, Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import HomeAssistantOverkizData
|
from . import HomeAssistantOverkizData
|
||||||
from .const import DOMAIN, IGNORED_OVERKIZ_DEVICES
|
from .const import DOMAIN
|
||||||
from .entity import OverkizDescriptiveEntity
|
from .entity import OverkizDescriptiveEntity
|
||||||
|
|
||||||
|
|
||||||
@ -107,19 +107,6 @@ SWITCH_DESCRIPTIONS: list[OverkizSwitchDescription] = [
|
|||||||
),
|
),
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
),
|
),
|
||||||
OverkizSwitchDescription(
|
|
||||||
key=UIWidget.DYNAMIC_SHUTTER,
|
|
||||||
name="Silent mode",
|
|
||||||
turn_on=OverkizCommand.ACTIVATE_OPTION,
|
|
||||||
turn_on_args=OverkizCommandParam.SILENCE,
|
|
||||||
turn_off=OverkizCommand.DEACTIVATE_OPTION,
|
|
||||||
turn_off_args=OverkizCommandParam.SILENCE,
|
|
||||||
is_on=lambda select_state: (
|
|
||||||
OverkizCommandParam.SILENCE
|
|
||||||
in cast(list, select_state(OverkizState.CORE_ACTIVATED_OPTIONS))
|
|
||||||
),
|
|
||||||
icon="mdi:feather",
|
|
||||||
),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
SUPPORTED_DEVICES = {
|
SUPPORTED_DEVICES = {
|
||||||
@ -136,13 +123,7 @@ async def async_setup_entry(
|
|||||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||||
entities: list[OverkizSwitch] = []
|
entities: list[OverkizSwitch] = []
|
||||||
|
|
||||||
for device in data.coordinator.data.values():
|
for device in data.platforms[Platform.SWITCH]:
|
||||||
if (
|
|
||||||
device.widget in IGNORED_OVERKIZ_DEVICES
|
|
||||||
or device.ui_class in IGNORED_OVERKIZ_DEVICES
|
|
||||||
):
|
|
||||||
continue
|
|
||||||
|
|
||||||
if description := SUPPORTED_DEVICES.get(device.widget) or SUPPORTED_DEVICES.get(
|
if description := SUPPORTED_DEVICES.get(device.widget) or SUPPORTED_DEVICES.get(
|
||||||
device.ui_class
|
device.ui_class
|
||||||
):
|
):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user