mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Add Buienradar apparent temperature and forecast rain chance & wind gust (#135287)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
parent
2eb1041f4b
commit
c6994731b1
@ -12,6 +12,7 @@ from buienradar.constants import (
|
|||||||
CONDITION,
|
CONDITION,
|
||||||
CONTENT,
|
CONTENT,
|
||||||
DATA,
|
DATA,
|
||||||
|
FEELTEMPERATURE,
|
||||||
FORECAST,
|
FORECAST,
|
||||||
HUMIDITY,
|
HUMIDITY,
|
||||||
MESSAGE,
|
MESSAGE,
|
||||||
@ -22,6 +23,7 @@ from buienradar.constants import (
|
|||||||
TEMPERATURE,
|
TEMPERATURE,
|
||||||
VISIBILITY,
|
VISIBILITY,
|
||||||
WINDAZIMUTH,
|
WINDAZIMUTH,
|
||||||
|
WINDGUST,
|
||||||
WINDSPEED,
|
WINDSPEED,
|
||||||
)
|
)
|
||||||
from buienradar.urls import JSON_FEED_URL, json_precipitation_forecast_url
|
from buienradar.urls import JSON_FEED_URL, json_precipitation_forecast_url
|
||||||
@ -200,6 +202,14 @@ class BrData:
|
|||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def feeltemperature(self):
|
||||||
|
"""Return the feeltemperature, or None."""
|
||||||
|
try:
|
||||||
|
return float(self.data.get(FEELTEMPERATURE))
|
||||||
|
except (ValueError, TypeError):
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def pressure(self):
|
def pressure(self):
|
||||||
"""Return the pressure, or None."""
|
"""Return the pressure, or None."""
|
||||||
@ -224,6 +234,14 @@ class BrData:
|
|||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def wind_gust(self):
|
||||||
|
"""Return the windgust, or None."""
|
||||||
|
try:
|
||||||
|
return float(self.data.get(WINDGUST))
|
||||||
|
except (ValueError, TypeError):
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def wind_speed(self):
|
def wind_speed(self):
|
||||||
"""Return the windspeed, or None."""
|
"""Return the windspeed, or None."""
|
||||||
|
@ -9,6 +9,7 @@ from buienradar.constants import (
|
|||||||
MAX_TEMP,
|
MAX_TEMP,
|
||||||
MIN_TEMP,
|
MIN_TEMP,
|
||||||
RAIN,
|
RAIN,
|
||||||
|
RAIN_CHANCE,
|
||||||
WINDAZIMUTH,
|
WINDAZIMUTH,
|
||||||
WINDSPEED,
|
WINDSPEED,
|
||||||
)
|
)
|
||||||
@ -33,6 +34,7 @@ from homeassistant.components.weather import (
|
|||||||
ATTR_FORECAST_NATIVE_TEMP,
|
ATTR_FORECAST_NATIVE_TEMP,
|
||||||
ATTR_FORECAST_NATIVE_TEMP_LOW,
|
ATTR_FORECAST_NATIVE_TEMP_LOW,
|
||||||
ATTR_FORECAST_NATIVE_WIND_SPEED,
|
ATTR_FORECAST_NATIVE_WIND_SPEED,
|
||||||
|
ATTR_FORECAST_PRECIPITATION_PROBABILITY,
|
||||||
ATTR_FORECAST_TIME,
|
ATTR_FORECAST_TIME,
|
||||||
ATTR_FORECAST_WIND_BEARING,
|
ATTR_FORECAST_WIND_BEARING,
|
||||||
Forecast,
|
Forecast,
|
||||||
@ -153,7 +155,9 @@ class BrWeather(WeatherEntity):
|
|||||||
)
|
)
|
||||||
self._attr_native_pressure = data.pressure
|
self._attr_native_pressure = data.pressure
|
||||||
self._attr_native_temperature = data.temperature
|
self._attr_native_temperature = data.temperature
|
||||||
|
self._attr_native_apparent_temperature = data.feeltemperature
|
||||||
self._attr_native_visibility = data.visibility
|
self._attr_native_visibility = data.visibility
|
||||||
|
self._attr_native_wind_gust_speed = data.wind_gust
|
||||||
self._attr_native_wind_speed = data.wind_speed
|
self._attr_native_wind_speed = data.wind_speed
|
||||||
self._attr_wind_bearing = data.wind_bearing
|
self._attr_wind_bearing = data.wind_bearing
|
||||||
|
|
||||||
@ -188,6 +192,7 @@ class BrWeather(WeatherEntity):
|
|||||||
ATTR_FORECAST_NATIVE_TEMP_LOW: data_in.get(MIN_TEMP),
|
ATTR_FORECAST_NATIVE_TEMP_LOW: data_in.get(MIN_TEMP),
|
||||||
ATTR_FORECAST_NATIVE_TEMP: data_in.get(MAX_TEMP),
|
ATTR_FORECAST_NATIVE_TEMP: data_in.get(MAX_TEMP),
|
||||||
ATTR_FORECAST_NATIVE_PRECIPITATION: data_in.get(RAIN),
|
ATTR_FORECAST_NATIVE_PRECIPITATION: data_in.get(RAIN),
|
||||||
|
ATTR_FORECAST_PRECIPITATION_PROBABILITY: data_in.get(RAIN_CHANCE),
|
||||||
ATTR_FORECAST_WIND_BEARING: data_in.get(WINDAZIMUTH),
|
ATTR_FORECAST_WIND_BEARING: data_in.get(WINDAZIMUTH),
|
||||||
ATTR_FORECAST_NATIVE_WIND_SPEED: data_in.get(WINDSPEED),
|
ATTR_FORECAST_NATIVE_WIND_SPEED: data_in.get(WINDSPEED),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user