Allow None on Renault binary sensors (#65997)
* Enable None on renault binary sensors * Adjust tests Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
d81139377c
commit
486c068111
2 changed files with 5 additions and 6 deletions
|
@ -64,10 +64,9 @@ class RenaultBinarySensor(
|
|||
@property
|
||||
def is_on(self) -> bool | None:
|
||||
"""Return true if the binary sensor is on."""
|
||||
return (
|
||||
self._get_data_attr(self.entity_description.on_key)
|
||||
== self.entity_description.on_value
|
||||
)
|
||||
if (data := self._get_data_attr(self.entity_description.on_key)) is None:
|
||||
return None
|
||||
return data == self.entity_description.on_value
|
||||
|
||||
|
||||
BINARY_SENSOR_TYPES: tuple[RenaultBinarySensorEntityDescription, ...] = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue