mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Fix naming and docstring in yale_smart_alarm select (#127141)
This commit is contained in:
parent
10805805fe
commit
fdd9fca5b3
@ -18,24 +18,24 @@ VOLUME_OPTIONS = {value.name.lower(): str(value.value) for value in YaleLockVolu
|
|||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant, entry: YaleConfigEntry, async_add_entities: AddEntitiesCallback
|
hass: HomeAssistant, entry: YaleConfigEntry, async_add_entities: AddEntitiesCallback
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the Yale switch entry."""
|
"""Set up the Yale select entry."""
|
||||||
|
|
||||||
coordinator = entry.runtime_data
|
coordinator = entry.runtime_data
|
||||||
|
|
||||||
async_add_entities(
|
async_add_entities(
|
||||||
YaleAutolockSwitch(coordinator, lock)
|
YaleLockVolumeSelect(coordinator, lock)
|
||||||
for lock in coordinator.locks
|
for lock in coordinator.locks
|
||||||
if lock.supports_lock_config()
|
if lock.supports_lock_config()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class YaleAutolockSwitch(YaleLockEntity, SelectEntity):
|
class YaleLockVolumeSelect(YaleLockEntity, SelectEntity):
|
||||||
"""Representation of a Yale autolock switch."""
|
"""Representation of a Yale lock volume select."""
|
||||||
|
|
||||||
_attr_translation_key = "volume"
|
_attr_translation_key = "volume"
|
||||||
|
|
||||||
def __init__(self, coordinator: YaleDataUpdateCoordinator, lock: YaleLock) -> None:
|
def __init__(self, coordinator: YaleDataUpdateCoordinator, lock: YaleLock) -> None:
|
||||||
"""Initialize the Yale Autolock Switch."""
|
"""Initialize the Yale volume select."""
|
||||||
super().__init__(coordinator, lock)
|
super().__init__(coordinator, lock)
|
||||||
self._attr_unique_id = f"{lock.sid()}-volume"
|
self._attr_unique_id = f"{lock.sid()}-volume"
|
||||||
self._attr_current_option = self.lock_data.volume().name.lower()
|
self._attr_current_option = self.lock_data.volume().name.lower()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user