mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Add motion sensor setting to tplink (#129393)
This commit is contained in:
parent
27e81fe0ed
commit
c6cb2884f4
@ -71,6 +71,12 @@
|
||||
},
|
||||
"child_lock": {
|
||||
"default": "mdi:account-lock"
|
||||
},
|
||||
"pir_enabled": {
|
||||
"default": "mdi:motion-sensor-off",
|
||||
"state": {
|
||||
"on": "mdi:motion-sensor"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
|
@ -193,6 +193,9 @@
|
||||
},
|
||||
"child_lock": {
|
||||
"name": "Child lock"
|
||||
},
|
||||
"pir_enabled": {
|
||||
"name": "Motion sensor"
|
||||
}
|
||||
},
|
||||
"number": {
|
||||
|
@ -51,6 +51,9 @@ SWITCH_DESCRIPTIONS: tuple[TPLinkSwitchEntityDescription, ...] = (
|
||||
TPLinkSwitchEntityDescription(
|
||||
key="child_lock",
|
||||
),
|
||||
TPLinkSwitchEntityDescription(
|
||||
key="pir_enabled",
|
||||
),
|
||||
)
|
||||
|
||||
SWITCH_DESCRIPTIONS_MAP = {desc.key: desc for desc in SWITCH_DESCRIPTIONS}
|
||||
|
@ -39,6 +39,11 @@
|
||||
"type": "Switch",
|
||||
"category": "Config"
|
||||
},
|
||||
"pir_enabled": {
|
||||
"value": true,
|
||||
"type": "Switch",
|
||||
"category": "Config"
|
||||
},
|
||||
"current_consumption": {
|
||||
"value": 5.23,
|
||||
"type": "Sensor",
|
||||
|
@ -311,6 +311,52 @@
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_states[switch.my_device_motion_sensor-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'switch',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'switch.my_device_motion_sensor',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Motion sensor',
|
||||
'platform': 'tplink',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'pir_enabled',
|
||||
'unique_id': '123456789ABCDEFGH_pir_enabled',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_states[switch.my_device_motion_sensor-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'my_device Motion sensor',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.my_device_motion_sensor',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_states[switch.my_device_smooth_transitions-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
Loading…
x
Reference in New Issue
Block a user