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 Franck Nijhof
parent c9c7c7803e
commit 036b6fca25
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

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