Skip to content

Commit

Permalink
Update sensor.py (cytech#40)
Browse files Browse the repository at this point in the history
Change unit of measurement to mm/hr or in/hr (from mm or in) for Precipitation Rate
  • Loading branch information
true-bluey authored Dec 23, 2020
1 parent 97c0c16 commit 972eac4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/wundergroundpws/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@
ALTITUDEUNIT = LENGTH_FEET
SPEEDUNIT = 'mph'
PRESSUREUNIT = 'inHg'
RATE = 'in/hr'
else:
TEMPUNIT = TEMP_CELSIUS
LENGTHUNIT = LENGTH_MILLIMETERS
ALTITUDEUNIT = LENGTH_METERS
SPEEDUNIT = 'kph'
PRESSUREUNIT = 'mBar'
RATE = 'mm/hr'


# Helper classes for declaring sensor configurations
Expand Down Expand Up @@ -248,7 +250,7 @@ def __init__(self, friendly_name, period, field,
'windChill': WUCurrentConditionsSensorConfig(
'Wind chill', UNIT_SYSTEM, 'windChill', "mdi:thermometer", TEMPUNIT),
'precipRate': WUCurrentConditionsSensorConfig(
'Precipitation Rate', UNIT_SYSTEM, 'precipRate', "mdi:umbrella", LENGTHUNIT),
'Precipitation Rate', UNIT_SYSTEM, 'precipRate', "mdi:umbrella", RATE),
'precipTotal': WUCurrentConditionsSensorConfig(
'Precipitation Today', UNIT_SYSTEM, 'precipTotal', "mdi:umbrella", LENGTHUNIT),
'pressure': WUCurrentConditionsSensorConfig(
Expand Down

0 comments on commit 972eac4

Please sign in to comment.