Do not use POWER_WATT for West wind direction (#34069)

This commit is contained in:
Quentame 2020-04-12 03:07:43 +02:00 committed by GitHub
parent 24c45bfd84
commit e273ff5e5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 9 deletions

View File

@ -4,13 +4,7 @@ import logging
import voluptuous as vol
from homeassistant.components.weather import PLATFORM_SCHEMA, WeatherEntity
from homeassistant.const import (
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_NAME,
POWER_WATT,
TEMP_CELSIUS,
)
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME, TEMP_CELSIUS
from homeassistant.helpers import config_validation as cv
# Reuse data and API logic from the sensor implementation
@ -105,7 +99,7 @@ class BOMWeather(WeatherEntity):
"SSW",
"SW",
"WSW",
POWER_WATT,
"W",
"WNW",
"NW",
"NNW",

View File

@ -414,7 +414,7 @@ def _get_wind_direction(wind_direction_degree: float) -> str:
if 236.25 <= wind_direction_degree < 258.75:
return "WSW"
if 258.75 <= wind_direction_degree < 281.25:
return POWER_WATT
return "W"
if 281.25 <= wind_direction_degree < 303.75:
return "WNW"
if 303.75 <= wind_direction_degree < 326.25: