Add only unique_id property to yeelightsunflower, not other changes (#36311)

pull/36357/head
Lindsay Ward 2020-06-02 02:36:43 +10:00 committed by GitHub
parent e5d81aeb2a
commit a333417ddf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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):
"""Set up the Yeelight Sunflower Light platform."""
host = config.get(CONF_HOST)
hub = yeelightsunflower.Hub(host)
@ -46,12 +45,18 @@ class SunflowerBulb(LightEntity):
self._brightness = light.brightness
self._is_on = light.is_on
self._hs_color = light.rgb_color
self._unique_id = light.zid
@property
def name(self):
"""Return the display name of this light."""
return f"sunflower_{self._light.zid}"
@property
def unique_id(self):
"""Return the unique ID of this light."""
return self._unique_id
@property
def available(self):
"""Return True if entity is available."""