Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Commit

Permalink
Tweak sensor state to handle missing attributes (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgarwood authored Dec 28, 2021
1 parent bd00731 commit 1cae445
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/fullykiosk/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def state(self):
if self._sensor in STORAGE_SENSORS:
return round(self.coordinator.data[self._sensor] * 0.000001, 1)

return self.coordinator.data[self._sensor]
return self.coordinator.data.get(self._sensor)

async def async_added_to_hass(self):
"""Connect to dispatcher listening for entity data notifications."""
Expand Down

0 comments on commit 1cae445

Please sign in to comment.