mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Do not use POWER_WATT for West wind direction (#34069)
This commit is contained in:
parent
24c45bfd84
commit
e273ff5e5e
@ -4,13 +4,7 @@ import logging
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.weather import PLATFORM_SCHEMA, WeatherEntity
|
from homeassistant.components.weather import PLATFORM_SCHEMA, WeatherEntity
|
||||||
from homeassistant.const import (
|
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME, TEMP_CELSIUS
|
||||||
CONF_LATITUDE,
|
|
||||||
CONF_LONGITUDE,
|
|
||||||
CONF_NAME,
|
|
||||||
POWER_WATT,
|
|
||||||
TEMP_CELSIUS,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
|
|
||||||
# Reuse data and API logic from the sensor implementation
|
# Reuse data and API logic from the sensor implementation
|
||||||
@ -105,7 +99,7 @@ class BOMWeather(WeatherEntity):
|
|||||||
"SSW",
|
"SSW",
|
||||||
"SW",
|
"SW",
|
||||||
"WSW",
|
"WSW",
|
||||||
POWER_WATT,
|
"W",
|
||||||
"WNW",
|
"WNW",
|
||||||
"NW",
|
"NW",
|
||||||
"NNW",
|
"NNW",
|
||||||
|
@ -414,7 +414,7 @@ def _get_wind_direction(wind_direction_degree: float) -> str:
|
|||||||
if 236.25 <= wind_direction_degree < 258.75:
|
if 236.25 <= wind_direction_degree < 258.75:
|
||||||
return "WSW"
|
return "WSW"
|
||||||
if 258.75 <= wind_direction_degree < 281.25:
|
if 258.75 <= wind_direction_degree < 281.25:
|
||||||
return POWER_WATT
|
return "W"
|
||||||
if 281.25 <= wind_direction_degree < 303.75:
|
if 281.25 <= wind_direction_degree < 303.75:
|
||||||
return "WNW"
|
return "WNW"
|
||||||
if 303.75 <= wind_direction_degree < 326.25:
|
if 303.75 <= wind_direction_degree < 326.25:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user