mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Migrate greenwave light to color_mode (#69258)
This commit is contained in:
parent
6b4e0c744c
commit
f04a3737a8
@ -10,8 +10,8 @@ import voluptuous as vol
|
|||||||
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
|
COLOR_MODE_BRIGHTNESS,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
SUPPORT_BRIGHTNESS,
|
|
||||||
LightEntity,
|
LightEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_HOST
|
from homeassistant.const import CONF_HOST
|
||||||
@ -25,8 +25,6 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
CONF_VERSION = "version"
|
CONF_VERSION = "version"
|
||||||
|
|
||||||
SUPPORTED_FEATURES = SUPPORT_BRIGHTNESS
|
|
||||||
|
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||||
{vol.Required(CONF_HOST): cv.string, vol.Required(CONF_VERSION): cv.positive_int}
|
{vol.Required(CONF_HOST): cv.string, vol.Required(CONF_VERSION): cv.positive_int}
|
||||||
)
|
)
|
||||||
@ -67,6 +65,9 @@ def setup_platform(
|
|||||||
class GreenwaveLight(LightEntity):
|
class GreenwaveLight(LightEntity):
|
||||||
"""Representation of an Greenwave Reality Light."""
|
"""Representation of an Greenwave Reality Light."""
|
||||||
|
|
||||||
|
_attr_color_mode = COLOR_MODE_BRIGHTNESS
|
||||||
|
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
||||||
|
|
||||||
def __init__(self, light, host, token, gatewaydata):
|
def __init__(self, light, host, token, gatewaydata):
|
||||||
"""Initialize a Greenwave Reality Light."""
|
"""Initialize a Greenwave Reality Light."""
|
||||||
self._did = int(light["did"])
|
self._did = int(light["did"])
|
||||||
@ -78,11 +79,6 @@ class GreenwaveLight(LightEntity):
|
|||||||
self._token = token
|
self._token = token
|
||||||
self._gatewaydata = gatewaydata
|
self._gatewaydata = gatewaydata
|
||||||
|
|
||||||
@property
|
|
||||||
def supported_features(self):
|
|
||||||
"""Flag supported features."""
|
|
||||||
return SUPPORTED_FEATURES
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self):
|
def available(self):
|
||||||
"""Return True if entity is available."""
|
"""Return True if entity is available."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user