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 GitHub
parent 542ab2dd76
commit 6e3c704a33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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