Improve type hints in light [a-i] (#75936)
* Improve type hints in ads light * Improve type hints in avea light * Improve type hints in avion light * Improve type hints in broadlink light * More type hints * One more
This commit is contained in:
parent
c795597511
commit
20fec104e2
19 changed files with 88 additions and 61 deletions
|
@ -2,6 +2,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import math
|
||||
from typing import Any
|
||||
|
||||
from enocean.utils import combine_hex
|
||||
import voluptuous as vol
|
||||
|
@ -80,7 +81,7 @@ class EnOceanLight(EnOceanEntity, LightEntity):
|
|||
"""If light is on."""
|
||||
return self._on_state
|
||||
|
||||
def turn_on(self, **kwargs):
|
||||
def turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn the light source on or sets a specific dimmer value."""
|
||||
if (brightness := kwargs.get(ATTR_BRIGHTNESS)) is not None:
|
||||
self._brightness = brightness
|
||||
|
@ -94,7 +95,7 @@ class EnOceanLight(EnOceanEntity, LightEntity):
|
|||
self.send_command(command, [], 0x01)
|
||||
self._on_state = True
|
||||
|
||||
def turn_off(self, **kwargs):
|
||||
def turn_off(self, **kwargs: Any) -> None:
|
||||
"""Turn the light source off."""
|
||||
command = [0xA5, 0x02, 0x00, 0x01, 0x09]
|
||||
command.extend(self._sender_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue