Add explicit return none and binary sensor availability to yeelight (#35649)

* Add explicit return none and binary sensor availbility

* Fix
pull/35667/head
zewelor 2020-05-15 17:41:53 +02:00 committed by GitHub
parent ddb5ed9dc8
commit 92756f9b12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -47,6 +47,13 @@ class YeelightNightlightModeSensor(BinarySensorEntity):
if unique:
return unique + "-nightlight_sensor"
return None
@property
def available(self) -> bool:
"""Return if bulb is available."""
return self._device.available
@property
def should_poll(self):
"""No polling needed."""

View File

@ -917,6 +917,8 @@ class YeelightNightLightMode(YeelightGenericLight):
if unique:
return unique + "-nightlight"
return None
@property
def name(self) -> str:
"""Return the name of the device if any."""