From 0e0ab4427b37b656d3a52fc0c428a23330b9dcc2 Mon Sep 17 00:00:00 2001 From: Mick Vleeshouwer Date: Sat, 29 Apr 2023 18:34:21 +0200 Subject: [PATCH] Revert "Add silent option for DynamicShutter (ogp:Shutter) in Overkiz" (#91354) --- homeassistant/components/overkiz/switch.py | 27 ++++------------------ 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/homeassistant/components/overkiz/switch.py b/homeassistant/components/overkiz/switch.py index a40bd731a0f..b7416711e77 100644 --- a/homeassistant/components/overkiz/switch.py +++ b/homeassistant/components/overkiz/switch.py @@ -3,7 +3,7 @@ from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass -from typing import Any, cast +from typing import Any from pyoverkiz.enums import OverkizCommand, OverkizCommandParam, OverkizState from pyoverkiz.enums.ui import UIClass, UIWidget @@ -15,12 +15,12 @@ from homeassistant.components.switch import ( SwitchEntityDescription, ) from homeassistant.config_entries import ConfigEntry -from homeassistant.const import EntityCategory +from homeassistant.const import EntityCategory, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import HomeAssistantOverkizData -from .const import DOMAIN, IGNORED_OVERKIZ_DEVICES +from .const import DOMAIN from .entity import OverkizDescriptiveEntity @@ -107,19 +107,6 @@ SWITCH_DESCRIPTIONS: list[OverkizSwitchDescription] = [ ), 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 = { @@ -136,13 +123,7 @@ async def async_setup_entry( data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id] entities: list[OverkizSwitch] = [] - for device in data.coordinator.data.values(): - if ( - device.widget in IGNORED_OVERKIZ_DEVICES - or device.ui_class in IGNORED_OVERKIZ_DEVICES - ): - continue - + for device in data.platforms[Platform.SWITCH]: if description := SUPPORTED_DEVICES.get(device.widget) or SUPPORTED_DEVICES.get( device.ui_class ):