Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ build.json @home-assistant/supervisor
/tests/components/adguard/ @frenck
/homeassistant/components/advantage_air/ @Bre77
/tests/components/advantage_air/ @Bre77
/homeassistant/components/aemet/ @Noltari
/tests/components/aemet/ @Noltari
/homeassistant/components/agent_dvr/ @ispysoftware
/tests/components/agent_dvr/ @ispysoftware
/homeassistant/components/air_quality/ @home-assistant/core
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/aemet/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/aemet",
"requirements": ["AEMET-OpenData==0.2.1"],
"codeowners": [],
"codeowners": ["@Noltari"],
"iot_class": "cloud_polling",
"loggers": ["aemet_opendata"]
}
8 changes: 5 additions & 3 deletions homeassistant/components/aemet/weather.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Support for the AEMET OpenData service."""
from homeassistant.components.weather import WeatherEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import TEMP_CELSIUS
from homeassistant.const import PRESSURE_HPA, SPEED_KILOMETERS_PER_HOUR, TEMP_CELSIUS
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
Expand Down Expand Up @@ -48,6 +48,8 @@ class AemetWeather(CoordinatorEntity[WeatherUpdateCoordinator], WeatherEntity):

_attr_attribution = ATTRIBUTION
_attr_temperature_unit = TEMP_CELSIUS
_attr_pressure_unit = PRESSURE_HPA
_attr_wind_speed_unit = SPEED_KILOMETERS_PER_HOUR

def __init__(
self,
Expand Down Expand Up @@ -92,10 +94,10 @@ def temperature(self):

@property
def wind_bearing(self):
"""Return the temperature."""
"""Return the wind bearing."""
return self.coordinator.data[ATTR_API_WIND_BEARING]

@property
def wind_speed(self):
"""Return the temperature."""
"""Return the wind speed."""
return self.coordinator.data[ATTR_API_WIND_SPEED]
6 changes: 3 additions & 3 deletions tests/components/aemet/test_weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ async def test_aemet_weather(hass):
assert state.state == ATTR_CONDITION_SNOWY
assert state.attributes.get(ATTR_ATTRIBUTION) == ATTRIBUTION
assert state.attributes.get(ATTR_WEATHER_HUMIDITY) == 99.0
assert state.attributes.get(ATTR_WEATHER_PRESSURE) == 1004.4
assert state.attributes.get(ATTR_WEATHER_PRESSURE) == 100440.0
assert state.attributes.get(ATTR_WEATHER_TEMPERATURE) == -0.7
assert state.attributes.get(ATTR_WEATHER_WIND_BEARING) == 90.0
assert state.attributes.get(ATTR_WEATHER_WIND_SPEED) == 15
assert state.attributes.get(ATTR_WEATHER_WIND_SPEED) == 4.17
forecast = state.attributes.get(ATTR_FORECAST)[0]
assert forecast.get(ATTR_FORECAST_CONDITION) == ATTR_CONDITION_PARTLYCLOUDY
assert forecast.get(ATTR_FORECAST_PRECIPITATION) is None
Expand All @@ -57,7 +57,7 @@ async def test_aemet_weather(hass):
== dt_util.parse_datetime("2021-01-10 00:00:00+00:00").isoformat()
)
assert forecast.get(ATTR_FORECAST_WIND_BEARING) == 45.0
assert forecast.get(ATTR_FORECAST_WIND_SPEED) == 20
assert forecast.get(ATTR_FORECAST_WIND_SPEED) == 5.56

state = hass.states.get("weather.aemet_hourly")
assert state is None