Skip to content

Commit

Permalink
fix: custom sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
JoDehli committed May 3, 2024
1 parent ea3c124 commit 4deb6de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion custom_components/loxone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
9 changes: 2 additions & 7 deletions custom_components/loxone/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4deb6de

Please sign in to comment.