Skip to content

Commit

Permalink
Fix no wind value
Browse files Browse the repository at this point in the history
  • Loading branch information
tguillaume02 authored Mar 28, 2022
1 parent efb4e1f commit 1fbc7df
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bin/user/wxWmr500.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ def f2km(f):
return f * 3.6
else:
return None

def f2winddir(f):
if isinstance(f, (float, int)):
return f * 22.5
else:
return None

# using to display good format mm
def mm2cm(f):
return f/10
Expand Down Expand Up @@ -191,9 +198,9 @@ def genLoopPackets(self):
# display shows wind direction using a circle with
# 18 segments,
'windSpeed': f2km(checkData(outdoor['w2']['c21'])),
'windDir': checkData(outdoor['w2']['c23']) * 22.5,
'windDir': f2winddir(checkData(outdoor['w2']['c23'])),
'windGust': f2km(checkData(outdoor['w2']['c22'])),
'windGustDir':checkData( outdoor['w2']['c24']) * 22.5,
'windGustDir': f2winddir(checkData( outdoor['w2']['c24'])),
'windchill': f2c(checkData(outdoor['w2']['c26'])),

'rain': 0
Expand Down

0 comments on commit 1fbc7df

Please sign in to comment.