Fix missing position attribute for MeteoFranceAlertSensor (#39938)
parent
c2a9a39ee0
commit
062ac5f27d
|
@ -79,6 +79,7 @@ class MeteoFranceSensor(CoordinatorEntity):
|
|||
"""Initialize the Meteo-France sensor."""
|
||||
super().__init__(coordinator)
|
||||
self._type = sensor_type
|
||||
if hasattr(self.coordinator.data, "position"):
|
||||
city_name = self.coordinator.data.position["name"]
|
||||
self._name = f"{city_name} {SENSOR_TYPES[self._type][ENTITY_NAME]}"
|
||||
self._unique_id = f"{self.coordinator.data.position['lat']},{self.coordinator.data.position['lon']}_{self._type}"
|
||||
|
|
Loading…
Reference in New Issue