Fix geo location attributes of Tankerkoenig sensors (#115914)

* geo location attributes needs to be float

* make mypy happy
This commit is contained in:
Michael 2024-04-21 11:44:58 +02:00 committed by GitHub
parent 1c0c0bb0bc
commit ec066472ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,7 +91,7 @@ class FuelPriceSensor(TankerkoenigCoordinatorEntity, SensorEntity):
self._fuel_type = fuel_type
self._attr_translation_key = fuel_type
self._attr_unique_id = f"{station.id}_{fuel_type}"
attrs = {
attrs: dict[str, int | str | float | None] = {
ATTR_BRAND: station.brand,
ATTR_FUEL_TYPE: fuel_type,
ATTR_STATION_NAME: station.name,
@ -102,8 +102,8 @@ class FuelPriceSensor(TankerkoenigCoordinatorEntity, SensorEntity):
}
if coordinator.show_on_map:
attrs[ATTR_LATITUDE] = str(station.lat)
attrs[ATTR_LONGITUDE] = str(station.lng)
attrs[ATTR_LATITUDE] = station.lat
attrs[ATTR_LONGITUDE] = station.lng
self._attr_extra_state_attributes = attrs
@property