diff --git a/homeassistant/components/overkiz/cover.py b/homeassistant/components/overkiz/cover.py index 3619aface736..f8c587218c4f 100644 --- a/homeassistant/components/overkiz/cover.py +++ b/homeassistant/components/overkiz/cover.py @@ -132,6 +132,20 @@ COVER_DESCRIPTIONS: list[OverkizCoverDescription] = [ close_tilt_command_args=(15, 1), # position (1-127), speed (1-15) stop_tilt_command=OverkizCommand.STOP, ), + # Needs override to support very specific tilt commands (rts:VenetianBlindRTSComponent) + # uiClass is VenetianBlind + OverkizCoverDescription( + key=UIWidget.UP_DOWN_VENETIAN_BLIND, + device_class=CoverDeviceClass.BLIND, + open_command=OverkizCommand.OPEN, + close_command=OverkizCommand.CLOSE, + stop_command=OverkizCommand.STOP, + open_tilt_command=OverkizCommand.TILT_POSITIVE, + open_tilt_command_args=(15, 1), # position (1-127), speed (1-15) + close_tilt_command=OverkizCommand.TILT_NEGATIVE, + close_tilt_command_args=(15, 1), # position (1-127), speed (1-15) + stop_tilt_command=OverkizCommand.STOP, + ), # Needs override since PositionableGarageDoor reports # core:OpenClosedUnknownState instead of core:OpenClosedState # uiClass is GarageDoor diff --git a/tests/components/overkiz/fixtures/setup/cloud_somfy_connexoon_rts_asia.json b/tests/components/overkiz/fixtures/setup/cloud_somfy_connexoon_rts_asia.json index 8ea89c840ca9..d3559a1344f2 100644 --- a/tests/components/overkiz/fixtures/setup/cloud_somfy_connexoon_rts_asia.json +++ b/tests/components/overkiz/fixtures/setup/cloud_somfy_connexoon_rts_asia.json @@ -380,6 +380,90 @@ "type": 1, "oid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "uiClass": "VenetianBlind" + }, + { + "creationTime": 1613676700000, + "lastUpdateTime": 1613676700000, + "label": "Office Venetian Blind", + "deviceURL": "rts://1234-1234-6362/16747291", + "shortcut": false, + "controllableName": "rts:VenetianBlindRTSComponent", + "definition": { + "commands": [ + { + "commandName": "close", + "nparams": 1 + }, + { + "commandName": "down", + "nparams": 1 + }, + { + "commandName": "identify", + "nparams": 0 + }, + { + "commandName": "my", + "nparams": 1 + }, + { + "commandName": "open", + "nparams": 1 + }, + { + "commandName": "rest", + "nparams": 1 + }, + { + "commandName": "stop", + "nparams": 1 + }, + { + "commandName": "test", + "nparams": 0 + }, + { + "commandName": "up", + "nparams": 1 + }, + { + "commandName": "moveOf", + "nparams": 2 + }, + { + "commandName": "openConfiguration", + "nparams": 1 + }, + { + "commandName": "tiltNegative", + "nparams": 2 + }, + { + "commandName": "tiltPositive", + "nparams": 2 + } + ], + "states": [], + "dataProperties": [ + { + "value": "0", + "qualifiedName": "core:identifyInterval" + } + ], + "widgetName": "UpDownVenetianBlind", + "uiProfiles": ["OpenCloseBlind", "OpenClose"], + "uiClass": "VenetianBlind", + "qualifiedName": "rts:VenetianBlindRTSComponent", + "type": "ACTUATOR" + }, + "attributes": [], + "available": true, + "enabled": true, + "placeOID": "6133b4a0-f514-4553-b635-d1b7beb7e7b2", + "widget": "UpDownVenetianBlind", + "type": 1, + "oid": "3496a041-cafc-4d5d-ab3b-7947985812dc", + "uiClass": "VenetianBlind" } ], "zones": [], diff --git a/tests/components/overkiz/snapshots/test_cover.ambr b/tests/components/overkiz/snapshots/test_cover.ambr index 7d0abf5fa1f7..c5e9f9a7fe0b 100644 --- a/tests/components/overkiz/snapshots/test_cover.ambr +++ b/tests/components/overkiz/snapshots/test_cover.ambr @@ -431,6 +431,60 @@ 'state': 'unknown', }) # --- +# name: test_cover_entities_snapshot[cloud_somfy_connexoon_rts_asia.json][cover.office_venetian_blind-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'cover', + 'entity_category': None, + 'entity_id': 'cover.office_venetian_blind', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': None, + 'platform': 'overkiz', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': None, + 'unique_id': 'rts://1234-1234-6362/16747291', + 'unit_of_measurement': None, + }) +# --- +# name: test_cover_entities_snapshot[cloud_somfy_connexoon_rts_asia.json][cover.office_venetian_blind-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assumed_state': True, + 'device_class': 'blind', + 'friendly_name': 'Office Venetian Blind', + 'is_closed': None, + 'supported_features': , + }), + 'context': , + 'entity_id': 'cover.office_venetian_blind', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- # name: test_cover_entities_snapshot[cloud_somfy_connexoon_rts_asia.json][cover.patio_shutter-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/overkiz/test_cover.py b/tests/components/overkiz/test_cover.py index 5967303a3342..64bfbb9d69a5 100644 --- a/tests/components/overkiz/test_cover.py +++ b/tests/components/overkiz/test_cover.py @@ -105,6 +105,11 @@ TILT_ONLY_VENETIAN_BLIND = FixtureDevice( "rts://1234-1234-6362/16730044", "cover.jaloezie", ) +UP_DOWN_VENETIAN_BLIND = FixtureDevice( + "setup/cloud_somfy_connexoon_rts_asia.json", + "rts://1234-1234-6362/16747291", + "cover.office_venetian_blind", +) DYNAMIC_GARAGE_DOOR = FixtureDevice( "setup/cloud_somfy_tahoma_v2_europe.json", "io://1234-1234-6233/16730050", @@ -182,6 +187,7 @@ async def test_cover_entities_snapshot( CoverState.OPENING, ), (TILT_ONLY_VENETIAN_BLIND, SERVICE_OPEN_COVER, "open", [0], CoverState.OPENING), + (UP_DOWN_VENETIAN_BLIND, SERVICE_OPEN_COVER, "open", [0], CoverState.OPENING), (SHUTTER, SERVICE_CLOSE_COVER, "close", None, CoverState.CLOSING), (AWNING, SERVICE_CLOSE_COVER, "undeploy", None, CoverState.CLOSING), (GARAGE, SERVICE_CLOSE_COVER, "close", None, CoverState.CLOSING), @@ -209,6 +215,7 @@ async def test_cover_entities_snapshot( [0], CoverState.CLOSING, ), + (UP_DOWN_VENETIAN_BLIND, SERVICE_CLOSE_COVER, "close", [0], CoverState.CLOSING), (SHUTTER, SERVICE_STOP_COVER, "stop", None, CoverState.CLOSED), (AWNING, SERVICE_STOP_COVER, "stop", None, CoverState.CLOSED), (GARAGE, SERVICE_STOP_COVER, "stop", None, CoverState.CLOSED), @@ -245,6 +252,28 @@ async def test_cover_entities_snapshot( [0], STATE_UNKNOWN, ), + (UP_DOWN_VENETIAN_BLIND, SERVICE_STOP_COVER, "stop", [0], STATE_UNKNOWN), + ( + UP_DOWN_VENETIAN_BLIND, + SERVICE_OPEN_COVER_TILT, + "tiltPositive", + [15, 1], + CoverState.OPENING, + ), + ( + UP_DOWN_VENETIAN_BLIND, + SERVICE_CLOSE_COVER_TILT, + "tiltNegative", + [15, 1], + CoverState.CLOSING, + ), + ( + UP_DOWN_VENETIAN_BLIND, + SERVICE_STOP_COVER_TILT, + "stop", + [0], + STATE_UNKNOWN, + ), ], ids=[ "open-roller-shutter", @@ -256,6 +285,7 @@ async def test_cover_entities_snapshot( "open-partial-garage-door", "open-up-down-bioclimatic-pergola", "open-tilt-only-venetian-blind", + "open-venetian-blind-rts", "close-roller-shutter", "close-awning", "close-garage-door", @@ -265,6 +295,7 @@ async def test_cover_entities_snapshot( "close-partial-garage-door", "close-up-down-bioclimatic-pergola", "close-tilt-only-venetian-blind", + "close-venetian-blind-rts", "stop-roller-shutter", "stop-awning", "stop-garage-door", @@ -277,6 +308,10 @@ async def test_cover_entities_snapshot( "open-tilt-tilt-only-venetian-blind", "close-tilt-tilt-only-venetian-blind", "stop-tilt-tilt-only-venetian-blind", + "stop-venetian-blind-rts", + "open-tilt-venetian-blind-rts", + "close-tilt-venetian-blind-rts", + "stop-tilt-venetian-blind-rts", ], ) async def test_cover_service_actions(