mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Add select for partial position (garage door) in Overkiz (#99500)
This commit is contained in:
parent
2a80164508
commit
2349e3ac1d
@ -42,6 +42,19 @@ def _select_option_open_closed_pedestrian(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _select_option_open_closed_partial(
|
||||||
|
option: str, execute_command: Callable[..., Awaitable[None]]
|
||||||
|
) -> Awaitable[None]:
|
||||||
|
"""Change the selected option for Open/Closed/Partial."""
|
||||||
|
return execute_command(
|
||||||
|
{
|
||||||
|
OverkizCommandParam.CLOSED: OverkizCommand.CLOSE,
|
||||||
|
OverkizCommandParam.OPEN: OverkizCommand.OPEN,
|
||||||
|
OverkizCommandParam.PARTIAL: OverkizCommand.PARTIAL_POSITION,
|
||||||
|
}[OverkizCommandParam(option)]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _select_option_memorized_simple_volume(
|
def _select_option_memorized_simple_volume(
|
||||||
option: str, execute_command: Callable[..., Awaitable[None]]
|
option: str, execute_command: Callable[..., Awaitable[None]]
|
||||||
) -> Awaitable[None]:
|
) -> Awaitable[None]:
|
||||||
@ -73,6 +86,18 @@ SELECT_DESCRIPTIONS: list[OverkizSelectDescription] = [
|
|||||||
select_option=_select_option_open_closed_pedestrian,
|
select_option=_select_option_open_closed_pedestrian,
|
||||||
translation_key="open_closed_pedestrian",
|
translation_key="open_closed_pedestrian",
|
||||||
),
|
),
|
||||||
|
OverkizSelectDescription(
|
||||||
|
key=OverkizState.CORE_OPEN_CLOSED_PARTIAL,
|
||||||
|
name="Position",
|
||||||
|
icon="mdi:content-save-cog",
|
||||||
|
options=[
|
||||||
|
OverkizCommandParam.OPEN,
|
||||||
|
OverkizCommandParam.PARTIAL,
|
||||||
|
OverkizCommandParam.CLOSED,
|
||||||
|
],
|
||||||
|
select_option=_select_option_open_closed_partial,
|
||||||
|
translation_key="open_closed_partial",
|
||||||
|
),
|
||||||
OverkizSelectDescription(
|
OverkizSelectDescription(
|
||||||
key=OverkizState.IO_MEMORIZED_SIMPLE_VOLUME,
|
key=OverkizState.IO_MEMORIZED_SIMPLE_VOLUME,
|
||||||
name="Memorized simple volume",
|
name="Memorized simple volume",
|
||||||
|
@ -64,6 +64,13 @@
|
|||||||
"closed": "[%key:common::state::closed%]"
|
"closed": "[%key:common::state::closed%]"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"open_closed_partial": {
|
||||||
|
"state": {
|
||||||
|
"open": "[%key:common::state::open%]",
|
||||||
|
"partial": "Partial",
|
||||||
|
"closed": "[%key:common::state::closed%]"
|
||||||
|
}
|
||||||
|
},
|
||||||
"memorized_simple_volume": {
|
"memorized_simple_volume": {
|
||||||
"state": {
|
"state": {
|
||||||
"highest": "Highest",
|
"highest": "Highest",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user