diff --git a/custom_components/loxone/__init__.py b/custom_components/loxone/__init__.py index 6508c35..8972854 100644 --- a/custom_components/loxone/__init__.py +++ b/custom_components/loxone/__init__.py @@ -428,7 +428,7 @@ def __init__(self, **kwargs): except (Exception,): traceback.print_exc() sys.exit(-1) - self._attr_name = self.name + self.listener = None async def async_added_to_hass(self): diff --git a/custom_components/loxone/sensor.py b/custom_components/loxone/sensor.py index d2edfe1..c081589 100644 --- a/custom_components/loxone/sensor.py +++ b/custom_components/loxone/sensor.py @@ -189,8 +189,8 @@ def async_add_sensors(_): class LoxoneCustomSensor(LoxoneEntity, SensorEntity): def __init__(self, **kwargs): - LoxoneEntity().__init__(**kwargs) - self._name = kwargs["name"] + super().__init__(**kwargs) + LoxoneEntity(**kwargs) if "uuidAction" in kwargs: self.uuidAction = kwargs["uuidAction"] else: @@ -226,11 +226,6 @@ async def event_handler(self, e): self.schedule_update_ha_state() - @property - def name(self): - """Return the name of the sensor.""" - return self._name - @property def native_value(self): return self._state