mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Adjust type hints in greewave (#77492)
This commit is contained in:
parent
809aa6b30f
commit
67db380253
@ -72,29 +72,14 @@ class GreenwaveLight(LightEntity):
|
||||
def __init__(self, light, host, token, gatewaydata):
|
||||
"""Initialize a Greenwave Reality Light."""
|
||||
self._did = int(light["did"])
|
||||
self._name = light["name"]
|
||||
self._attr_name = light["name"]
|
||||
self._state = int(light["state"])
|
||||
self._brightness = greenwave.hass_brightness(light)
|
||||
self._attr_brightness = greenwave.hass_brightness(light)
|
||||
self._host = host
|
||||
self._online = greenwave.check_online(light)
|
||||
self._attr_available = greenwave.check_online(light)
|
||||
self._token = token
|
||||
self._gatewaydata = gatewaydata
|
||||
|
||||
@property
|
||||
def available(self):
|
||||
"""Return True if entity is available."""
|
||||
return self._online
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the display name of this light."""
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def brightness(self):
|
||||
"""Return the brightness of the light."""
|
||||
return self._brightness
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
"""Return true if light is on."""
|
||||
@ -116,9 +101,9 @@ class GreenwaveLight(LightEntity):
|
||||
bulbs = self._gatewaydata.greenwave
|
||||
|
||||
self._state = int(bulbs[self._did]["state"])
|
||||
self._brightness = greenwave.hass_brightness(bulbs[self._did])
|
||||
self._online = greenwave.check_online(bulbs[self._did])
|
||||
self._name = bulbs[self._did]["name"]
|
||||
self._attr_brightness = greenwave.hass_brightness(bulbs[self._did])
|
||||
self._attr_available = greenwave.check_online(bulbs[self._did])
|
||||
self._attr_name = bulbs[self._did]["name"]
|
||||
|
||||
|
||||
class GatewayData:
|
||||
|
Loading…
x
Reference in New Issue
Block a user