Ignore None keys in meteo_france extra state attributes (#163297)

This commit is contained in:
epenet
2026-02-18 17:18:27 +01:00
committed by GitHub
parent e3c98dcd09
commit eb7d973252

View File

@@ -333,10 +333,14 @@ class MeteoFranceAlertSensor(MeteoFranceSensor[CurrentPhenomenons]):
)
@property
def extra_state_attributes(self):
def extra_state_attributes(self) -> dict[str, Any]:
"""Return the state attributes."""
return {
**readable_phenomenons_dict(self.coordinator.data.phenomenons_max_colors),
k: v
for k, v in readable_phenomenons_dict(
self.coordinator.data.phenomenons_max_colors
).items()
if k is not None
}