From 2cfd78bc49860319182abb99432afd2e2393a2ad Mon Sep 17 00:00:00 2001 From: carstenschroeder Date: Sat, 21 Aug 2021 14:17:19 +0200 Subject: [PATCH] Minor refactoring of keba integration (#54976) * minor refactoring * fix type annotation --- homeassistant/components/keba/sensor.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/keba/sensor.py b/homeassistant/components/keba/sensor.py index a1e0387c707..fc761074bc7 100644 --- a/homeassistant/components/keba/sensor.py +++ b/homeassistant/components/keba/sensor.py @@ -16,7 +16,7 @@ from homeassistant.const import ( POWER_KILO_WATT, ) -from . import DOMAIN +from . import DOMAIN, KebaHandler async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): @@ -90,14 +90,13 @@ class KebaSensor(SensorEntity): def __init__( self, - keba, - entity_type, + keba: KebaHandler, + entity_type: str, description: SensorEntityDescription, - ): + ) -> None: """Initialize the KEBA Sensor.""" self._keba = keba self.entity_description = description - self._entity_type = entity_type self._attr_name = f"{keba.device_name} {description.name}" self._attr_unique_id = f"{keba.device_id}_{entity_type}"