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
2 changes: 2 additions & 0 deletions homeassistant/components/overkiz/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ def is_closed(self) -> bool | None:
"""Return if the cover is closed."""
if is_closed_state := self.entity_description.is_closed_state:
if state := self.device.states.get(is_closed_state):
if state.value == OverkizCommandParam.UNKNOWN:
return None
return state.value == OverkizCommandParam.CLOSED

if (position := self.current_cover_position) is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,76 @@
"oid": "0df95043-359c-4b3d-9147-f49b2b35053c",
"uiClass": "GarageDoor"
},
{
"creationTime": 1521964729000,
"lastUpdateTime": 1521964729000,
"label": "Basement Garage Door",
"deviceURL": "io://1234-1234-6233/1166864",
"shortcut": false,
"controllableName": "io:GarageOpenerIOComponent",
"definition": {
"commands": [
{
"commandName": "close",
"nparams": 0
},
{
"commandName": "open",
"nparams": 0
},
{
"commandName": "setClosure",
"nparams": 1
},
{
"commandName": "stop",
"nparams": 0
}
],
"states": [
{
"type": "ContinuousState",
"qualifiedName": "core:ClosureState"
},
{
"type": "DiscreteState",
"values": ["closed", "open", "unknown"],
"qualifiedName": "core:OpenClosedUnknownState"
}
],
"widgetName": "PositionableGarageDoor",
"uiProfiles": [
"StatefulCloseableGarageOpener",
"StatefulCloseable",
"Closeable",
"OpenClose"
],
"uiClass": "GarageDoor",
"qualifiedName": "io:GarageOpenerIOComponent",
"type": "ACTUATOR"
},
"states": [
{
"name": "core:OpenClosedUnknownState",
"type": 3,
"value": "unknown"
}
],
"attributes": [
{
"name": "core:Manufacturer",
"type": 3,
"value": "Somfy"
}
],
"available": true,
"enabled": true,
"placeOID": "bcbb34ef-2241-43a1-9c5b-523aa0563ec3",
"widget": "PositionableGarageDoor",
"type": 1,
"oid": "1df95043-359c-4b3d-9147-f49b2b35053d",
"uiClass": "GarageDoor"
},
{
"creationTime": 1552163547000,
"lastUpdateTime": 1552163547000,
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 @@ -919,6 +919,59 @@
'state': 'open',
})
# ---
# name: test_cover_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][cover.basement_garage_door-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.basement_garage_door',
'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: 15>,
'translation_key': None,
'unique_id': 'io://1234-1234-6233/1166864',
'unit_of_measurement': None,
})
# ---
# name: test_cover_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][cover.basement_garage_door-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'garage',
'friendly_name': 'Basement Garage Door',
'is_closed': None,
'supported_features': <CoverEntityFeature: 15>,
}),
'context': <ANY>,
'entity_id': 'cover.basement_garage_door',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_cover_entities_snapshot[cloud_somfy_tahoma_v2_europe.json][cover.bedroom_blinds-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
Expand Down