Migrate SMHI to new entity naming style (#75213)

This commit is contained in:
G Johansson 2022-07-22 11:57:36 +02:00 committed by GitHub
parent 630c28d253
commit 06c8eb0304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,6 +126,8 @@ class SmhiWeather(WeatherEntity):
_attr_native_wind_speed_unit = SPEED_METERS_PER_SECOND _attr_native_wind_speed_unit = SPEED_METERS_PER_SECOND
_attr_native_pressure_unit = PRESSURE_HPA _attr_native_pressure_unit = PRESSURE_HPA
_attr_has_entity_name = True
def __init__( def __init__(
self, self,
name: str, name: str,
@ -134,8 +136,6 @@ class SmhiWeather(WeatherEntity):
session: aiohttp.ClientSession, session: aiohttp.ClientSession,
) -> None: ) -> None:
"""Initialize the SMHI weather entity.""" """Initialize the SMHI weather entity."""
self._attr_name = name
self._attr_unique_id = f"{latitude}, {longitude}" self._attr_unique_id = f"{latitude}, {longitude}"
self._forecasts: list[SmhiForecast] | None = None self._forecasts: list[SmhiForecast] | None = None
self._fail_count = 0 self._fail_count = 0