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
11 changes: 11 additions & 0 deletions homeassistant/components/overkiz/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,17 @@ class OverkizCoverDescription(CoverEntityDescription):
is_closed_state=OverkizState.CORE_OPEN_CLOSED_PEDESTRIAN,
stop_command=OverkizCommand.STOP,
),
# Needs override since SlidingDiscreteGateWithPedestrianPosition reports
# core:OpenClosedPedestrianState instead of core:OpenClosedState
# uiClass is Gate
OverkizCoverDescription(
key=UIWidget.SLIDING_DISCRETE_GATE_WITH_PEDESTRIAN_POSITION,
device_class=CoverDeviceClass.GATE,
open_command=OverkizCommand.OPEN,
close_command=OverkizCommand.CLOSE,
is_closed_state=OverkizState.CORE_OPEN_CLOSED_PEDESTRIAN,
stop_command=OverkizCommand.STOP,
),
# Needs override to support this Generic device (rts:GenericRTSComponent)
# uiClass is Generic (not mapped to cover as this is a Generic device class)
OverkizCoverDescription(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7441,6 +7441,128 @@
"oid": "6ba9b1de-8037-41d7-9150-21f7d5f49a3f",
"uiClass": "Gate"
},
{
"creationTime": 1654894302000,
"lastUpdateTime": 1654894302000,
"label": "Sliding Gate",
"deviceURL": "io://1234-1234-6233/16730051",
"shortcut": false,
"controllableName": "io:SlidingDiscreteGateOpenerIOComponent",
"definition": {
"commands": [
{
"commandName": "close",
"nparams": 0
},
{
"commandName": "identify",
"nparams": 0
},
{
"commandName": "open",
"nparams": 0
},
{
"commandName": "refreshPedestrianPosition",
"nparams": 0
},
{
"commandName": "setPedestrianPosition",
"nparams": 0
},
{
"commandName": "stop",
"nparams": 0
}
],
"states": [
{
"type": "DiscreteState",
"values": ["good", "low", "normal", "verylow"],
"qualifiedName": "core:DiscreteRSSILevelState"
},
{
"type": "DataState",
"qualifiedName": "core:NameState"
},
{
"type": "DiscreteState",
"values": ["closed", "open", "pedestrian", "unknown"],
"qualifiedName": "core:OpenClosedPedestrianState"
},
{
"type": "ContinuousState",
"qualifiedName": "core:PedestrianPositionState"
},
{
"type": "ContinuousState",
"qualifiedName": "core:RSSILevelState"
},
{
"type": "DiscreteState",
"values": ["available", "unavailable"],
"qualifiedName": "core:StatusState"
}
],
"dataProperties": [],
"widgetName": "SlidingDiscreteGateWithPedestrianPosition",
"uiProfiles": ["OpenCloseGateOpener", "OpenClose"],
"uiClass": "Gate",
"qualifiedName": "io:SlidingDiscreteGateOpenerIOComponent",
"type": "ACTUATOR"
},
"states": [
{
"name": "core:NameState",
"type": 3,
"value": "Sliding Gate"
},
{
"name": "core:StatusState",
"type": 3,
"value": "available"
},
{
"name": "core:DiscreteRSSILevelState",
"type": 3,
"value": "normal"
},
{
"name": "core:RSSILevelState",
"type": 2,
"value": 50.0
},
{
"name": "core:OpenClosedPedestrianState",
"type": 3,
"value": "closed"
},
{
"name": "core:PedestrianPositionState",
"type": 1,
"value": 50
}
],
"attributes": [
{
"name": "core:Manufacturer",
"type": 3,
"value": "Somfy"
},
{
"name": "core:FirmwareRevision",
"type": 3,
"value": "5107456G05"
}
],
"available": true,
"enabled": true,
"placeOID": "bcbb34ef-2241-43a1-9c5b-523aa0563ec3",
"widget": "SlidingDiscreteGateWithPedestrianPosition",
"type": 1,
"oid": "c1e2f3a4-b5d6-7890-abcd-ef1234567890",
"uiClass": "Gate"
},
{
"creationTime": 1521964729000,
"lastUpdateTime": 1521964729000,
Expand Down
51 changes: 51 additions & 0 deletions tests/components/overkiz/snapshots/test_button.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -4462,6 +4462,57 @@
'state': 'unknown',
})
# ---
# name: test_button_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][button.sliding_gate_start_identify-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': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'button.sliding_gate_start_identify',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Start identify',
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:human-greeting-variant',
'original_name': 'Start identify',
'platform': 'overkiz',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'io://1234-1234-6233/16730051-identify',
'unit_of_measurement': None,
})
# ---
# name: test_button_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][button.sliding_gate_start_identify-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Sliding Gate Start identify',
'icon': 'mdi:human-greeting-variant',
}),
'context': <ANY>,
'entity_id': 'button.sliding_gate_start_identify',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_button_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][button.start_identify-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
Expand Down
53 changes: 53 additions & 0 deletions tests/components/overkiz/snapshots/test_cover.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -2047,6 +2047,59 @@
'state': 'closed',
})
# ---
# name: test_cover_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][cover.sliding_gate-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.sliding_gate',
'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.GATE: 'gate'>,
'original_icon': None,
'original_name': None,
'platform': 'overkiz',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <CoverEntityFeature: 11>,
'translation_key': None,
'unique_id': 'io://1234-1234-6233/16730051',
'unit_of_measurement': None,
})
# ---
# name: test_cover_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][cover.sliding_gate-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'gate',
'friendly_name': 'Sliding Gate',
'is_closed': True,
'supported_features': <CoverEntityFeature: 11>,
}),
'context': <ANY>,
'entity_id': 'cover.sliding_gate',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'closed',
})
# ---
# name: test_cover_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][cover.studio_shutter-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
Expand Down
11 changes: 11 additions & 0 deletions tests/components/overkiz/test_cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@
"io://1234-1234-6233/7433515",
"cover.partial_garage_door",
)
SLIDING_DISCRETE_GATE = FixtureDevice(
"setup/cloud_somfy_tahoma_v2_europe.json",
"io://1234-1234-6233/16730051",
"cover.sliding_gate",
)
DYNAMIC_GATE = FixtureDevice(
"setup/cloud_somfy_tahoma_v2_europe.json",
"ogp://1234-1234-6233/10410217",
Expand Down Expand Up @@ -182,6 +187,7 @@ async def test_cover_entities_snapshot(
(DYNAMIC_GARAGE_DOOR, SERVICE_OPEN_COVER, "open", None, CoverState.OPENING),
(DYNAMIC_GARAGE_DOOR_OGP, SERVICE_OPEN_COVER, "open", None, CoverState.OPENING),
(DYNAMIC_GATE, SERVICE_OPEN_COVER, "open", None, CoverState.OPENING),
(SLIDING_DISCRETE_GATE, SERVICE_OPEN_COVER, "open", None, CoverState.OPENING),
(PARTIAL_GARAGE_DOOR, SERVICE_OPEN_COVER, "open", None, CoverState.OPENING),
(
UP_DOWN_BIOCLIMATIC_PERGOLA,
Expand All @@ -205,6 +211,7 @@ async def test_cover_entities_snapshot(
CoverState.CLOSING,
),
(DYNAMIC_GATE, SERVICE_CLOSE_COVER, "close", None, CoverState.CLOSING),
(SLIDING_DISCRETE_GATE, SERVICE_CLOSE_COVER, "close", None, CoverState.CLOSING),
(PARTIAL_GARAGE_DOOR, SERVICE_CLOSE_COVER, "close", None, CoverState.CLOSING),
(
UP_DOWN_BIOCLIMATIC_PERGOLA,
Expand All @@ -228,6 +235,7 @@ async def test_cover_entities_snapshot(
(DYNAMIC_GARAGE_DOOR, SERVICE_STOP_COVER, "stop", None, CoverState.CLOSED),
(DYNAMIC_GARAGE_DOOR_OGP, SERVICE_STOP_COVER, "stop", None, CoverState.CLOSED),
(DYNAMIC_GATE, SERVICE_STOP_COVER, "stop", None, CoverState.OPEN),
(SLIDING_DISCRETE_GATE, SERVICE_STOP_COVER, "stop", None, CoverState.CLOSED),
(PARTIAL_GARAGE_DOOR, SERVICE_STOP_COVER, "stop", None, CoverState.CLOSED),
(
UP_DOWN_BIOCLIMATIC_PERGOLA,
Expand Down Expand Up @@ -310,6 +318,7 @@ async def test_cover_entities_snapshot(
"open-dynamic-garage-door",
"open-dynamic-garage-door-ogp",
"open-dynamic-gate",
"open-sliding-discrete-gate",
"open-partial-garage-door",
"open-up-down-bioclimatic-pergola",
"open-tilt-only-venetian-blind",
Expand All @@ -321,6 +330,7 @@ async def test_cover_entities_snapshot(
"close-dynamic-garage-door",
"close-dynamic-garage-door-ogp",
"close-dynamic-gate",
"close-sliding-discrete-gate",
"close-partial-garage-door",
"close-up-down-bioclimatic-pergola",
"close-tilt-only-venetian-blind",
Expand All @@ -332,6 +342,7 @@ async def test_cover_entities_snapshot(
"stop-dynamic-garage-door",
"stop-dynamic-garage-door-ogp",
"stop-dynamic-gate",
"stop-sliding-discrete-gate",
"stop-partial-garage-door",
"stop-up-down-bioclimatic-pergola",
"stop-tilt-only-venetian-blind",
Expand Down