mirror of
https://github.com/home-assistant/core.git
synced 2025-08-02 12:15:08 +02: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:
@@ -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."""
|
||||||
|
Reference in New Issue
Block a user