-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a 'scale' function to conversions
This is just multiplication of two numbers, but can handle one of them being 'None'. Signed-off-by: Jim Easterbrook <jim@jim-easterbrook.me.uk>
- Loading branch information
1 parent
6eb7960
commit 61dabbb
Showing
2 changed files
with
21 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
__version__ = '18.8.0' | ||
_release = '1619' | ||
_commit = 'ff164bd' | ||
_release = '1620' | ||
_commit = '6eb7960' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61dabbb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dear Jim,
Could this be used to handle the 'thw' data upload in the weathercloud uploader better? I'm thinking we could replace
#calc "(usaheatindex(data['temp_out'], data['hum_out'], dew_point(data['temp_out'], data['hum_out'])) - (1.072 * wind_mph(data['wind_ave']))) " "'thw' : '%.1f',"#
with
#calc "(usaheatindex(data['temp_out'], data['hum_out'], dew_point(data['temp_out'], data['hum_out'])) - (scale(wind_mph(data['wind_ave'], 1.072))) " "'thw' : '%.1f',"#
Apologises if I got the brackets wrong in the above, do you think this will work?
Kind Regards
Richard
61dabbb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's a good example. It might also be used to scale all the data by 10.0 to remove the need to edit out decimal points.
61dabbb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See commit 115abc8.
@ashenshugarRET PS The only remaining decimal point is in the wind direction. What does the weathercloud API say to send for wind direction?
61dabbb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "thw" calculation could still end up doing subtraction on 'None', so I've done a better solution in commit 00a047f.