mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fix nightlight support detection (#36656)
This commit is contained in:
parent
d4d233536f
commit
986853d497
@ -239,11 +239,12 @@ class YeelightDevice:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def is_nightlight_supported(self) -> bool:
|
def is_nightlight_supported(self) -> bool:
|
||||||
"""Return true / false if nightlight is supported."""
|
"""
|
||||||
if self.model:
|
Return true / false if nightlight is supported.
|
||||||
return self.bulb.get_model_specs().get("night_light", False)
|
|
||||||
|
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
|
return self._nightlight_brightness is not None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -333,6 +334,12 @@ class YeelightDevice:
|
|||||||
"""Request device capabilities."""
|
"""Request device capabilities."""
|
||||||
try:
|
try:
|
||||||
self.bulb.get_capabilities()
|
self.bulb.get_capabilities()
|
||||||
|
_LOGGER.debug(
|
||||||
|
"Device %s, %s capabilities: %s",
|
||||||
|
self.ipaddr,
|
||||||
|
self.name,
|
||||||
|
self.bulb.capabilities,
|
||||||
|
)
|
||||||
except BulbException as ex:
|
except BulbException as ex:
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Unable to get device capabilities %s, %s: %s",
|
"Unable to get device capabilities %s, %s: %s",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user