diff --git a/homeassistant/components/tankerkoenig/__init__.py b/homeassistant/components/tankerkoenig/__init__.py index f1dbc26fc3a..39ae0c2fc16 100644 --- a/homeassistant/components/tankerkoenig/__init__.py +++ b/homeassistant/components/tankerkoenig/__init__.py @@ -170,6 +170,8 @@ class TankerkoenigDataUpdateCoordinator(DataUpdateCoordinator): class TankerkoenigCoordinatorEntity(CoordinatorEntity): """Tankerkoenig base entity.""" + _attr_has_entity_name = True + def __init__( self, coordinator: TankerkoenigDataUpdateCoordinator, station: dict ) -> None: diff --git a/homeassistant/components/tankerkoenig/binary_sensor.py b/homeassistant/components/tankerkoenig/binary_sensor.py index 5f10b54f704..a6a79fd2d92 100644 --- a/homeassistant/components/tankerkoenig/binary_sensor.py +++ b/homeassistant/components/tankerkoenig/binary_sensor.py @@ -43,6 +43,7 @@ class StationOpenBinarySensorEntity(TankerkoenigCoordinatorEntity, BinarySensorE """Shows if a station is open or closed.""" _attr_device_class = BinarySensorDeviceClass.DOOR + _attr_translation_key = "status" def __init__( self, @@ -53,9 +54,6 @@ class StationOpenBinarySensorEntity(TankerkoenigCoordinatorEntity, BinarySensorE """Initialize the sensor.""" super().__init__(coordinator, station) self._station_id = station["id"] - self._attr_name = ( - f"{station['brand']} {station['street']} {station['houseNumber']} status" - ) self._attr_unique_id = f"{station['id']}_status" if show_on_map: self._attr_extra_state_attributes = { diff --git a/homeassistant/components/tankerkoenig/sensor.py b/homeassistant/components/tankerkoenig/sensor.py index 1638a8c3abb..af21ac4b6d6 100644 --- a/homeassistant/components/tankerkoenig/sensor.py +++ b/homeassistant/components/tankerkoenig/sensor.py @@ -20,7 +20,6 @@ from .const import ( ATTR_STREET, ATTRIBUTION, DOMAIN, - FUEL_TYPES, ) _LOGGER = logging.getLogger(__name__) @@ -59,6 +58,7 @@ class FuelPriceSensor(TankerkoenigCoordinatorEntity, SensorEntity): _attr_attribution = ATTRIBUTION _attr_state_class = SensorStateClass.MEASUREMENT + _attr_native_unit_of_measurement = CURRENCY_EURO _attr_icon = "mdi:gas-station" def __init__(self, fuel_type, station, coordinator, show_on_map): @@ -66,8 +66,7 @@ class FuelPriceSensor(TankerkoenigCoordinatorEntity, SensorEntity): super().__init__(coordinator, station) self._station_id = station["id"] self._fuel_type = fuel_type - self._attr_name = f"{station['brand']} {station['street']} {station['houseNumber']} {FUEL_TYPES[fuel_type]}" - self._attr_native_unit_of_measurement = CURRENCY_EURO + self._attr_translation_key = fuel_type self._attr_unique_id = f"{station['id']}_{fuel_type}" attrs = { ATTR_BRAND: station["brand"], diff --git a/homeassistant/components/tankerkoenig/strings.json b/homeassistant/components/tankerkoenig/strings.json index dea370f45b3..43d444b2c46 100644 --- a/homeassistant/components/tankerkoenig/strings.json +++ b/homeassistant/components/tankerkoenig/strings.json @@ -43,5 +43,23 @@ } } } + }, + "entity": { + "binary_sensor": { + "status": { + "name": "Status" + } + }, + "sensor": { + "e5": { + "name": "Super" + }, + "e10": { + "name": "Super E10" + }, + "diesel": { + "name": "Diesel" + } + } } }