diff --git a/homeassistant/components/tplink/binary_sensor.py b/homeassistant/components/tplink/binary_sensor.py index 0e426161a0c..34375bccf4f 100644 --- a/homeassistant/components/tplink/binary_sensor.py +++ b/homeassistant/components/tplink/binary_sensor.py @@ -58,6 +58,10 @@ BINARY_SENSOR_DESCRIPTIONS: Final = ( key="water_alert", device_class=BinarySensorDeviceClass.MOISTURE, ), + TPLinkBinarySensorEntityDescription( + key="motion_detected", + device_class=BinarySensorDeviceClass.MOTION, + ), ) BINARYSENSOR_DESCRIPTIONS_MAP = {desc.key: desc for desc in BINARY_SENSOR_DESCRIPTIONS} diff --git a/tests/components/tplink/fixtures/features.json b/tests/components/tplink/fixtures/features.json index 30e1654001b..550592d3f48 100644 --- a/tests/components/tplink/fixtures/features.json +++ b/tests/components/tplink/fixtures/features.json @@ -200,6 +200,11 @@ "type": "BinarySensor", "category": "Primary" }, + "motion_detected": { + "value": false, + "type": "BinarySensor", + "category": "Primary" + }, "alarm": { "value": false, "type": "BinarySensor", diff --git a/tests/components/tplink/snapshots/test_binary_sensor.ambr b/tests/components/tplink/snapshots/test_binary_sensor.ambr index 832d300d66a..4a1cfe5b411 100644 --- a/tests/components/tplink/snapshots/test_binary_sensor.ambr +++ b/tests/components/tplink/snapshots/test_binary_sensor.ambr @@ -206,6 +206,53 @@ 'state': 'off', }) # --- +# name: test_states[binary_sensor.my_device_motion-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + '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': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + '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': , + 'entity_id': 'binary_sensor.my_device_motion', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_states[binary_sensor.my_device_overheated-entry] EntityRegistryEntrySnapshot({ 'aliases': set({