mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Add options-property to Plugwise Select (#117655)
This commit is contained in:
parent
3cd1717437
commit
fe6df8db1e
@ -89,13 +89,17 @@ class PlugwiseSelectEntity(PlugwiseEntity, SelectEntity):
|
||||
super().__init__(coordinator, device_id)
|
||||
self.entity_description = entity_description
|
||||
self._attr_unique_id = f"{device_id}-{entity_description.key}"
|
||||
self._attr_options = self.device[entity_description.options_key]
|
||||
|
||||
@property
|
||||
def current_option(self) -> str:
|
||||
"""Return the selected entity option to represent the entity state."""
|
||||
return self.device[self.entity_description.key]
|
||||
|
||||
@property
|
||||
def options(self) -> list[str]:
|
||||
"""Return the available select-options."""
|
||||
return self.device[self.entity_description.options_key]
|
||||
|
||||
async def async_select_option(self, option: str) -> None:
|
||||
"""Change to the selected entity option."""
|
||||
await self.entity_description.command(
|
||||
|
Loading…
x
Reference in New Issue
Block a user