Skip to content

Commit

Permalink
Multi Zone Naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Wieskamp committed Apr 11, 2024
1 parent ef610a9 commit 181536b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions custom_components/everlights/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,18 @@ def __init__(
super().__init__(coordinator, entity_description, serial)
self.entity_description = entity_description
self.serial = serial
self._name = f'{serial} {entity_description.name}'
aliases = []
for sequence in coordinator.client.sequences:
aliases.append(sequence["alias"])
self._attr_effect_list = aliases
self._attr_effect_list.sort()

@property
def name(self):
return self._name


@property
def is_on(self) -> bool:
"""Return true if the light is on."""
Expand Down
2 changes: 1 addition & 1 deletion custom_components/everlights/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"issue_tracker": "https://github.com/theOrakle/everlightsv3/issues",
"loggers": ["custom_components.everlights"],
"requirements": [],
"version": "1.0.8",
"version": "1.0.9",
"dependencies": [],
"codeowners": ["@theOrakle"]
}
5 changes: 5 additions & 0 deletions custom_components/everlights/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ def __init__(
"""Initialize the sensor class."""
super().__init__(coordinator,entity_description,serial)
self.entity_description = entity_description
self._name = f'{serial} {entity_description.name}'
self.serial = serial

@property
def name(self):
return self._name

@property
def native_value(self) -> str:
"""Return the native value of the sensor."""
Expand Down

0 comments on commit 181536b

Please sign in to comment.