Skip to content

Commit bc6ee98

Browse files
committed
overkiz: Add select for partial position (garage door)
The Somfy Dexxo smart io (io:DiscreteGarageOpenerWithPartialPositionIOComponent) supports a third position state: partial. This state is meant to be used to ventilate the garage. This commit adds a select entity for the position state. The implementation is very similar to the already existing position state for gate's with a pedestrian position. Note: For the updates to work properly, we'd still need iMicknl/ha-tahoma#167 / iMicknl/ha-tahoma#271 to be implemented. See Somfy-Developer/Somfy-TaHoma-Developer-Mode#26 for discussion with Somfy.
1 parent efe8c3c commit bc6ee98

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

homeassistant/components/overkiz/select.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ def _select_option_open_closed_pedestrian(
4141
}[OverkizCommandParam(option)]
4242
)
4343

44+
def _select_option_open_closed_partial(
45+
option: str, execute_command: Callable[..., Awaitable[None]]
46+
) -> Awaitable[None]:
47+
"""Change the selected option for Open/Closed/Partial."""
48+
return execute_command(
49+
{
50+
OverkizCommandParam.CLOSED: OverkizCommand.CLOSE,
51+
OverkizCommandParam.OPEN: OverkizCommand.OPEN,
52+
OverkizCommandParam.PARTIAL: "setPartialPosition", # FIXME
53+
}[OverkizCommandParam(option)]
54+
)
4455

4556
def _select_option_memorized_simple_volume(
4657
option: str, execute_command: Callable[..., Awaitable[None]]
@@ -73,6 +84,18 @@ def _select_option_active_zone(
7384
select_option=_select_option_open_closed_pedestrian,
7485
translation_key="open_closed_pedestrian",
7586
),
87+
OverkizSelectDescription(
88+
key=OverkizState.CORE_OPEN_CLOSED_PARTIAL,
89+
name="Position",
90+
icon="mdi:content-save-cog",
91+
options=[
92+
OverkizCommandParam.OPEN,
93+
OverkizCommandParam.PARTIAL,
94+
OverkizCommandParam.CLOSED,
95+
],
96+
select_option=_select_option_open_closed_partial,
97+
translation_key="open_closed_partial",
98+
),
7699
OverkizSelectDescription(
77100
key=OverkizState.IO_MEMORIZED_SIMPLE_VOLUME,
78101
name="Memorized simple volume",

homeassistant/components/overkiz/strings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@
6464
"closed": "[%key:common::state::closed%]"
6565
}
6666
},
67+
"open_closed_partial": {
68+
"state": {
69+
"open": "[%key:common::state::open%]",
70+
"partial": "Partial",
71+
"closed": "[%key:common::state::closed%]"
72+
}
73+
},
6774
"memorized_simple_volume": {
6875
"state": {
6976
"highest": "Highest",

0 commit comments

Comments
 (0)