Fix unknown values in onewire (#113731)
* Fix unknown values in onewire * Update tests
This commit is contained in:
parent
6859bae0b1
commit
33678ff5a4
5 changed files with 17 additions and 9 deletions
|
@ -143,6 +143,8 @@ class OneWireBinarySensor(OneWireEntity, BinarySensorEntity):
|
|||
entity_description: OneWireBinarySensorEntityDescription
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
def is_on(self) -> bool | None:
|
||||
"""Return true if sensor is on."""
|
||||
if self._state is None:
|
||||
return None
|
||||
return bool(self._state)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue