Skip to content

Commit

Permalink
Corrected windrose states
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGos committed Feb 14, 2024
1 parent f3c30e9 commit effa92b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 41 deletions.
16 changes: 8 additions & 8 deletions custom_components/davis_vantage/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"wind_direction_rose": {
"default": "mdi:compass-outline",
"state": {
"N": "mdi:arrow-down-bold-outline",
"NE": "mdi:arrow-bottom-left-bold-outline",
"E": "mdi:arrow-left-bold-outline",
"SE": "mdi:arrow-top-left-bold-outline",
"S": "mdi:arrow-up-bold-outline",
"SW": "mdi:arrow-top-right-bold-outline",
"W": "mdi:arrow-right-bold-outline",
"NW": "mdi:arrow-bottom-right-bold-outline"
"n": "mdi:arrow-down-bold-outline",
"ne": "mdi:arrow-bottom-left-bold-outline",
"e": "mdi:arrow-left-bold-outline",
"se": "mdi:arrow-top-left-bold-outline",
"s": "mdi:arrow-up-bold-outline",
"sw": "mdi:arrow-top-right-bold-outline",
"w": "mdi:arrow-right-bold-outline",
"nw": "mdi:arrow-bottom-right-bold-outline"
}
}
}
Expand Down
24 changes: 8 additions & 16 deletions custom_components/davis_vantage/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,14 @@
},
"wind_direction_rose": {
"state": {
"N": "N",
"NNE": "NNE",
"NE": "NE",
"ENE": "ENE",
"E": "E",
"ESE": "ESE",
"SE": "SE",
"SSE": "SSE",
"S": "S",
"SSW": "SSW",
"SW": "SW",
"WSW": "WSW",
"W": "W",
"WNW": "WNW",
"NW": "NW",
"NNW": "NNW"
"n": "N",
"ne": "NE",
"e": "E",
"se": "SE",
"s": "S",
"sw": "SW",
"w": "W",
"nw": "NW"
}
}
}
Expand Down
24 changes: 8 additions & 16 deletions custom_components/davis_vantage/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,14 @@
},
"wind_direction_rose": {
"state": {
"N": "N",
"NNE": "NNO",
"NE": "NO",
"ENE": "ONO",
"E": "O",
"ESE": "OZO",
"SE": "ZO",
"SSE": "ZZO",
"S": "Z",
"SSW": "ZZW",
"SW": "ZW",
"WSW": "WZW",
"W": "W",
"WNW": "WNW",
"NW": "NW",
"NNW": "NNW"
"n": "N",
"ne": "NO",
"e": "O",
"se": "ZO",
"s": "Z",
"sw": "ZW",
"w": "W",
"nw": "NW"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/davis_vantage/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def convert_to_iso_datetime(value: datetime, tzinfo: ZoneInfo) -> datetime:
return value.replace(tzinfo=tzinfo)

def get_wind_rose(bearing: int) -> str:
directions = [ 'N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW' ]
directions = [ 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw' ]
index = round(bearing / 45) % 8
return directions[index]

Expand Down

0 comments on commit effa92b

Please sign in to comment.