mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Add explicit return none and binary sensor availability to yeelight (#35649)
* Add explicit return none and binary sensor availbility * Fix
This commit is contained in:
parent
ddb5ed9dc8
commit
92756f9b12
@ -47,6 +47,13 @@ class YeelightNightlightModeSensor(BinarySensorEntity):
|
|||||||
if unique:
|
if unique:
|
||||||
return unique + "-nightlight_sensor"
|
return unique + "-nightlight_sensor"
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def available(self) -> bool:
|
||||||
|
"""Return if bulb is available."""
|
||||||
|
return self._device.available
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
"""No polling needed."""
|
"""No polling needed."""
|
||||||
|
@ -917,6 +917,8 @@ class YeelightNightLightMode(YeelightGenericLight):
|
|||||||
if unique:
|
if unique:
|
||||||
return unique + "-nightlight"
|
return unique + "-nightlight"
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self) -> str:
|
def name(self) -> str:
|
||||||
"""Return the name of the device if any."""
|
"""Return the name of the device if any."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user