Skip to content

Commit

Permalink
Merge pull request #60 from astrandb/GuardNoDirection
Browse files Browse the repository at this point in the history
Display unknown when wind dierection is missing
  • Loading branch information
astrandb authored Nov 24, 2023
2 parents a23ea6e + 03b5a32 commit 26692bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/weatherlink/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ def native_value(self):
return self.coordinator.data.get(self.entity_description.tag)

if self.entity_description.tag in [DataKey.WIND_DIR]:
if self.coordinator.data[self.entity_description.tag] is None:
return None

directions = [
"n",
"nne",
Expand Down

0 comments on commit 26692bd

Please sign in to comment.