Return None when value is not known in OpenHardwareMonitor (#101127)

* Return None when value is not known

* Add to coverage
This commit is contained in:
Joost Lekkerkerker 2023-09-30 05:07:11 +02:00 committed by Franck Nijhof
parent 730acb34f2
commit 822af4d40d
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
2 changed files with 3 additions and 0 deletions

View File

@ -898,6 +898,7 @@ omit =
homeassistant/components/opengarage/cover.py
homeassistant/components/opengarage/entity.py
homeassistant/components/opengarage/sensor.py
homeassistant/components/openhardwaremonitor/sensor.py
homeassistant/components/openhome/__init__.py
homeassistant/components/openhome/const.py
homeassistant/components/openhome/media_player.py

View File

@ -79,6 +79,8 @@ class OpenHardwareMonitorDevice(SensorEntity):
@property
def native_value(self):
"""Return the state of the device."""
if self.value == "-":
return None
return self.value
@property