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