Add door state binary sensor to SmartThings (#141143)

This commit is contained in:
Joost Lekkerkerker 2025-03-22 20:04:21 +01:00 committed by GitHub
parent b47d3076cc
commit f245bbd8dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 155 additions and 0 deletions

View File

@ -134,6 +134,14 @@ CAPABILITY_TO_SENSORS: dict[
is_on_key="wet",
)
},
Capability.SAMSUNG_CE_DOOR_STATE: {
Attribute.DOOR_STATE: SmartThingsBinarySensorEntityDescription(
key=Attribute.DOOR_STATE,
translation_key="door",
device_class=BinarySensorDeviceClass.OPENING,
is_on_key="open",
)
},
}

View File

@ -33,6 +33,9 @@
"acceleration": {
"name": "Acceleration"
},
"door": {
"name": "[%key:component::binary_sensor::entity_component::door::name%]"
},
"filter_status": {
"name": "Filter status"
},

View File

@ -190,6 +190,54 @@
'state': 'off',
})
# ---
# name: test_all_entities[da_ks_microwave_0101x][binary_sensor.microwave_door-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.microwave_door',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.OPENING: 'opening'>,
'original_icon': None,
'original_name': 'Door',
'platform': 'smartthings',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'door',
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a.doorState',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[da_ks_microwave_0101x][binary_sensor.microwave_door-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'opening',
'friendly_name': 'Microwave Door',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.microwave_door',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_all_entities[da_ks_microwave_0101x][binary_sensor.microwave_remote_control-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
@ -284,6 +332,54 @@
'state': 'off',
})
# ---
# name: test_all_entities[da_ks_oven_01061][binary_sensor.oven_door-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.oven_door',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.OPENING: 'opening'>,
'original_icon': None,
'original_name': 'Door',
'platform': 'smartthings',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'door',
'unique_id': '9447959a-0dfa-6b27-d40d-650da525c53f.doorState',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[da_ks_oven_01061][binary_sensor.oven_door-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'opening',
'friendly_name': 'Oven Door',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.oven_door',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_all_entities[da_ks_oven_01061][binary_sensor.oven_remote_control-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
@ -378,6 +474,54 @@
'state': 'off',
})
# ---
# name: test_all_entities[da_ks_range_0101x][binary_sensor.vulcan_door-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.vulcan_door',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.OPENING: 'opening'>,
'original_icon': None,
'original_name': 'Door',
'platform': 'smartthings',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'door',
'unique_id': '2c3cbaa0-1899-5ddc-7b58-9d657bd48f18.doorState',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[da_ks_range_0101x][binary_sensor.vulcan_door-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'opening',
'friendly_name': 'Vulcan Door',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.vulcan_door',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_all_entities[da_ks_range_0101x][binary_sensor.vulcan_remote_control-entry]
EntityRegistryEntrySnapshot({
'aliases': set({