mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Minor refactoring of keba integration (#54976)
* minor refactoring * fix type annotation
This commit is contained in:
parent
59809503d1
commit
2cfd78bc49
@ -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}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user