mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Fix deconz typing (#68143)
This commit is contained in:
parent
376ac1bd83
commit
283f4555a4
@ -3,7 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import ValuesView
|
||||
from typing import Any, cast
|
||||
from typing import Any
|
||||
|
||||
from pydeconz.group import Group
|
||||
from pydeconz.light import (
|
||||
@ -220,15 +220,11 @@ class DeconzBaseLight(DeconzDevice, LightEntity):
|
||||
elif "IKEA" in self._device.manufacturer:
|
||||
data["transition_time"] = 0
|
||||
|
||||
if (
|
||||
alert := FLASH_TO_DECONZ.get(cast(str, kwargs.get(ATTR_FLASH)))
|
||||
) is not None:
|
||||
if (alert := FLASH_TO_DECONZ.get(kwargs.get(ATTR_FLASH, ""))) is not None:
|
||||
data["alert"] = alert
|
||||
del data["on"]
|
||||
|
||||
if (
|
||||
effect := EFFECT_TO_DECONZ.get(cast(str, kwargs.get(ATTR_EFFECT)))
|
||||
) is not None:
|
||||
if (effect := EFFECT_TO_DECONZ.get(kwargs.get(ATTR_EFFECT, ""))) is not None:
|
||||
data["effect"] = effect
|
||||
|
||||
await self._device.set_state(**data)
|
||||
@ -244,9 +240,7 @@ class DeconzBaseLight(DeconzDevice, LightEntity):
|
||||
data["brightness"] = 0
|
||||
data["transition_time"] = int(attr_transition * 10)
|
||||
|
||||
if (
|
||||
alert := FLASH_TO_DECONZ.get(cast(str, kwargs.get(ATTR_FLASH)))
|
||||
) is not None:
|
||||
if (alert := FLASH_TO_DECONZ.get(kwargs.get(ATTR_FLASH, ""))) is not None:
|
||||
data["alert"] = alert
|
||||
del data["on"]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user