mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Add motion detected binary_sensor for tplink (#127883)
* Add motion binary_sensor for tplink * Remove strings definition as we have device class that handles this * Simplify instructions * Remove mentions about fixture creation and snapshot updates as requested * re-add newline
This commit is contained in:
parent
9cc934a972
commit
55ae43ed03
@ -58,6 +58,10 @@ BINARY_SENSOR_DESCRIPTIONS: Final = (
|
|||||||
key="water_alert",
|
key="water_alert",
|
||||||
device_class=BinarySensorDeviceClass.MOISTURE,
|
device_class=BinarySensorDeviceClass.MOISTURE,
|
||||||
),
|
),
|
||||||
|
TPLinkBinarySensorEntityDescription(
|
||||||
|
key="motion_detected",
|
||||||
|
device_class=BinarySensorDeviceClass.MOTION,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
BINARYSENSOR_DESCRIPTIONS_MAP = {desc.key: desc for desc in BINARY_SENSOR_DESCRIPTIONS}
|
BINARYSENSOR_DESCRIPTIONS_MAP = {desc.key: desc for desc in BINARY_SENSOR_DESCRIPTIONS}
|
||||||
|
@ -200,6 +200,11 @@
|
|||||||
"type": "BinarySensor",
|
"type": "BinarySensor",
|
||||||
"category": "Primary"
|
"category": "Primary"
|
||||||
},
|
},
|
||||||
|
"motion_detected": {
|
||||||
|
"value": false,
|
||||||
|
"type": "BinarySensor",
|
||||||
|
"category": "Primary"
|
||||||
|
},
|
||||||
"alarm": {
|
"alarm": {
|
||||||
"value": false,
|
"value": false,
|
||||||
"type": "BinarySensor",
|
"type": "BinarySensor",
|
||||||
|
@ -206,6 +206,53 @@
|
|||||||
'state': 'off',
|
'state': 'off',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_states[binary_sensor.my_device_motion-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'binary_sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'binary_sensor.my_device_motion',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <BinarySensorDeviceClass.MOTION: 'motion'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Motion',
|
||||||
|
'platform': 'tplink',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'motion_detected',
|
||||||
|
'unique_id': '123456789ABCDEFGH_motion_detected',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_states[binary_sensor.my_device_motion-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'motion',
|
||||||
|
'friendly_name': 'my_device Motion',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'binary_sensor.my_device_motion',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'off',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_states[binary_sensor.my_device_overheated-entry]
|
# name: test_states[binary_sensor.my_device_overheated-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user