Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions homeassistant/components/overkiz/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,31 @@ class OverkizCoverDescription(CoverEntityDescription):
open_command=OverkizCommand.CYCLE,
close_command=OverkizCommand.CYCLE,
),
# Needs override since UpDownGarageDoor4T only supports the cycle command
# (rts:GarageDoor4TRTSComponent)
# uiClass is GarageDoor
OverkizCoverDescription(
key=UIWidget.UP_DOWN_GARAGE_DOOR_4T,
device_class=CoverDeviceClass.GARAGE,
open_command=OverkizCommand.CYCLE,
close_command=OverkizCommand.CYCLE,
),
# Needs override since OpenCloseSlidingGarageDoor4T only supports the cycle command
# uiClass is GarageDoor
OverkizCoverDescription(
key=UIWidget.OPEN_CLOSE_SLIDING_GARAGE_DOOR_4T,
device_class=CoverDeviceClass.GARAGE,
open_command=OverkizCommand.CYCLE,
close_command=OverkizCommand.CYCLE,
),
Comment on lines +249 to +256
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have decided (for now) to only add real-world fixtures.

# Needs override since OpenCloseSlidingGate4T only supports the cycle command
# uiClass is Gate
OverkizCoverDescription(
key=UIWidget.OPEN_CLOSE_SLIDING_GATE_4T,
device_class=CoverDeviceClass.GATE,
open_command=OverkizCommand.CYCLE,
close_command=OverkizCommand.CYCLE,
),
Comment thread
iMicknl marked this conversation as resolved.
# Needs override since CyclicGarageDoor only supports the cycle command
# (io:CyclicGarageOpenerIOComponent)
# uiClass is GarageDoor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7473,6 +7473,43 @@
"oid": "a1b2c3d4-e5f6-7890-abcd-ef1234567891",
"uiClass": "Gate"
},
{
"creationTime": 1676547436000,
"lastUpdateTime": 1676547436000,
"label": "RTS Garage Door 4T",
"deviceURL": "rts://1234-1234-6233/16721270",
"shortcut": false,
"controllableName": "rts:GarageDoor4TRTSComponent",
"definition": {
"commands": [
{
"commandName": "cycle",
"nparams": 1
}
],
"states": [],
"dataProperties": [
{
"value": "0",
"qualifiedName": "core:identifyInterval"
}
],
"widgetName": "UpDownGarageDoor4T",
"uiProfiles": ["CyclicGarageOpener", "Cyclic"],
"uiClass": "GarageDoor",
"qualifiedName": "rts:GarageDoor4TRTSComponent",
"type": "ACTUATOR"
},
"states": [],
"attributes": [],
"available": true,
"enabled": true,
"placeOID": "bcbb34ef-2241-43a1-9c5b-523aa0563ec3",
"widget": "UpDownGarageDoor4T",
"type": 1,
"oid": "a1b2c3d4-e5f6-7890-abcd-ef1234567892",
"uiClass": "GarageDoor"
},
{
"creationTime": 1654894302000,
"lastUpdateTime": 1654894302000,
Expand Down
52 changes: 52 additions & 0 deletions tests/components/overkiz/snapshots/test_button.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -5023,6 +5023,58 @@
'state': 'unknown',
})
# ---
# name: test_button_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][button.rts_garage_door_4t_toggle-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'button',
'entity_category': None,
'entity_id': 'button.rts_garage_door_4t_toggle',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Toggle',
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:sync',
'original_name': 'Toggle',
'platform': 'overkiz',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'rts://1234-1234-6233/16721270-cycle',
'unit_of_measurement': None,
})
# ---
# name: test_button_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][button.rts_garage_door_4t_toggle-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'assumed_state': True,
'friendly_name': 'RTS Garage Door 4T Toggle',
'icon': 'mdi:sync',
}),
'context': <ANY>,
'entity_id': 'button.rts_garage_door_4t_toggle',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_button_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][button.rts_gate_toggle-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
Expand Down
54 changes: 54 additions & 0 deletions tests/components/overkiz/snapshots/test_cover.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -2155,6 +2155,60 @@
'state': 'open',
})
# ---
# name: test_cover_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][cover.rts_garage_door_4t-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'cover',
'entity_category': None,
'entity_id': 'cover.rts_garage_door_4t',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': None,
'options': dict({
}),
'original_device_class': <CoverDeviceClass.GARAGE: 'garage'>,
'original_icon': None,
'original_name': None,
'platform': 'overkiz',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <CoverEntityFeature: 3>,
'translation_key': None,
'unique_id': 'rts://1234-1234-6233/16721270',
'unit_of_measurement': None,
})
# ---
# name: test_cover_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][cover.rts_garage_door_4t-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'assumed_state': True,
'device_class': 'garage',
'friendly_name': 'RTS Garage Door 4T',
'is_closed': None,
'supported_features': <CoverEntityFeature: 3>,
}),
'context': <ANY>,
'entity_id': 'cover.rts_garage_door_4t',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_cover_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][cover.rts_gate-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
Expand Down
9 changes: 9 additions & 0 deletions tests/components/overkiz/test_cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@
"rts://1234-1234-6233/16730717",
"cover.rts_gate",
)
RTS_GARAGE_DOOR_4T = FixtureDevice(
"setup/cloud_somfy_tahoma_v2_europe.json",
"rts://1234-1234-6233/16721270",
"cover.rts_garage_door_4t",
)
CYCLIC_GARAGE_DOOR = FixtureDevice(
"setup/cloud_somfy_tahoma_v2_europe.json",
"io://1234-1234-6233/6416929",
Expand Down Expand Up @@ -229,6 +234,7 @@ async def test_cover_entities_snapshot(
(DYNAMIC_GARAGE_DOOR_OGP, SERVICE_OPEN_COVER, "open", None, CoverState.OPENING),
(DYNAMIC_GATE, SERVICE_OPEN_COVER, "open", None, CoverState.OPENING),
(RTS_GATE_4T, SERVICE_OPEN_COVER, "cycle", [0], CoverState.OPENING),
(RTS_GARAGE_DOOR_4T, SERVICE_OPEN_COVER, "cycle", [0], CoverState.OPENING),
(CYCLIC_GARAGE_DOOR, SERVICE_OPEN_COVER, "cycle", None, CoverState.OPENING),
(CYCLIC_SWINGING_GATE, SERVICE_OPEN_COVER, "cycle", None, CoverState.OPENING),
(SLIDING_DISCRETE_GATE, SERVICE_OPEN_COVER, "open", None, CoverState.OPENING),
Expand Down Expand Up @@ -274,6 +280,7 @@ async def test_cover_entities_snapshot(
# Cycle command is used for both open and close; device reports OPENING
# since the RTS protocol has no directional feedback.
(RTS_GATE_4T, SERVICE_CLOSE_COVER, "cycle", [0], CoverState.OPENING),
(RTS_GARAGE_DOOR_4T, SERVICE_CLOSE_COVER, "cycle", [0], CoverState.OPENING),
(CYCLIC_GARAGE_DOOR, SERVICE_CLOSE_COVER, "cycle", None, CoverState.OPENING),
(CYCLIC_SWINGING_GATE, SERVICE_CLOSE_COVER, "cycle", None, CoverState.OPENING),
(SLIDING_DISCRETE_GATE, SERVICE_CLOSE_COVER, "close", None, CoverState.CLOSING),
Expand Down Expand Up @@ -416,6 +423,7 @@ async def test_cover_entities_snapshot(
"open-dynamic-garage-door-ogp",
"open-dynamic-gate",
"open-rts-gate-4t",
"open-rts-garage-door-4t",
"open-cyclic-garage-door",
"open-cyclic-swinging-gate",
"open-sliding-discrete-gate",
Expand All @@ -435,6 +443,7 @@ async def test_cover_entities_snapshot(
"close-dynamic-garage-door-ogp",
"close-dynamic-gate",
"close-rts-gate-4t",
"close-rts-garage-door-4t",
"close-cyclic-garage-door",
"close-cyclic-swinging-gate",
"close-sliding-discrete-gate",
Expand Down