From 986853d497db4e4b0ca4310632b7ecb904bde2ab Mon Sep 17 00:00:00 2001 From: zewelor Date: Fri, 12 Jun 2020 00:46:00 +0200 Subject: [PATCH] Fix nightlight support detection (#36656) --- homeassistant/components/yeelight/__init__.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/yeelight/__init__.py b/homeassistant/components/yeelight/__init__.py index c36c7be00fa..b0413599fe3 100644 --- a/homeassistant/components/yeelight/__init__.py +++ b/homeassistant/components/yeelight/__init__.py @@ -239,11 +239,12 @@ class YeelightDevice: @property def is_nightlight_supported(self) -> bool: - """Return true / false if nightlight is supported.""" - if self.model: - return self.bulb.get_model_specs().get("night_light", False) + """ + Return true / false if nightlight is supported. + + Uses brightness as it appears to be supported in both ceiling and other lights. + """ - # It should support both ceiling and other lights return self._nightlight_brightness is not None @property @@ -333,6 +334,12 @@ class YeelightDevice: """Request device capabilities.""" try: self.bulb.get_capabilities() + _LOGGER.debug( + "Device %s, %s capabilities: %s", + self.ipaddr, + self.name, + self.bulb.capabilities, + ) except BulbException as ex: _LOGGER.error( "Unable to get device capabilities %s, %s: %s",