mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Add only unique_id property to yeelightsunflower, not other changes (#36311)
This commit is contained in:
parent
e5d81aeb2a
commit
a333417ddf
@ -25,7 +25,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({vol.Required(CONF_HOST): cv.string})
|
|||||||
|
|
||||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||||
"""Set up the Yeelight Sunflower Light platform."""
|
"""Set up the Yeelight Sunflower Light platform."""
|
||||||
|
|
||||||
host = config.get(CONF_HOST)
|
host = config.get(CONF_HOST)
|
||||||
hub = yeelightsunflower.Hub(host)
|
hub = yeelightsunflower.Hub(host)
|
||||||
|
|
||||||
@ -46,12 +45,18 @@ class SunflowerBulb(LightEntity):
|
|||||||
self._brightness = light.brightness
|
self._brightness = light.brightness
|
||||||
self._is_on = light.is_on
|
self._is_on = light.is_on
|
||||||
self._hs_color = light.rgb_color
|
self._hs_color = light.rgb_color
|
||||||
|
self._unique_id = light.zid
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the display name of this light."""
|
"""Return the display name of this light."""
|
||||||
return f"sunflower_{self._light.zid}"
|
return f"sunflower_{self._light.zid}"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
"""Return the unique ID of this light."""
|
||||||
|
return self._unique_id
|
||||||
|
|
||||||
@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