mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Add motion sensor setting to tplink (#129393)
This commit is contained in:
parent
27e81fe0ed
commit
c6cb2884f4
@ -71,6 +71,12 @@
|
|||||||
},
|
},
|
||||||
"child_lock": {
|
"child_lock": {
|
||||||
"default": "mdi:account-lock"
|
"default": "mdi:account-lock"
|
||||||
|
},
|
||||||
|
"pir_enabled": {
|
||||||
|
"default": "mdi:motion-sensor-off",
|
||||||
|
"state": {
|
||||||
|
"on": "mdi:motion-sensor"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sensor": {
|
"sensor": {
|
||||||
|
@ -193,6 +193,9 @@
|
|||||||
},
|
},
|
||||||
"child_lock": {
|
"child_lock": {
|
||||||
"name": "Child lock"
|
"name": "Child lock"
|
||||||
|
},
|
||||||
|
"pir_enabled": {
|
||||||
|
"name": "Motion sensor"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"number": {
|
"number": {
|
||||||
|
@ -51,6 +51,9 @@ SWITCH_DESCRIPTIONS: tuple[TPLinkSwitchEntityDescription, ...] = (
|
|||||||
TPLinkSwitchEntityDescription(
|
TPLinkSwitchEntityDescription(
|
||||||
key="child_lock",
|
key="child_lock",
|
||||||
),
|
),
|
||||||
|
TPLinkSwitchEntityDescription(
|
||||||
|
key="pir_enabled",
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
SWITCH_DESCRIPTIONS_MAP = {desc.key: desc for desc in SWITCH_DESCRIPTIONS}
|
SWITCH_DESCRIPTIONS_MAP = {desc.key: desc for desc in SWITCH_DESCRIPTIONS}
|
||||||
|
@ -39,6 +39,11 @@
|
|||||||
"type": "Switch",
|
"type": "Switch",
|
||||||
"category": "Config"
|
"category": "Config"
|
||||||
},
|
},
|
||||||
|
"pir_enabled": {
|
||||||
|
"value": true,
|
||||||
|
"type": "Switch",
|
||||||
|
"category": "Config"
|
||||||
|
},
|
||||||
"current_consumption": {
|
"current_consumption": {
|
||||||
"value": 5.23,
|
"value": 5.23,
|
||||||
"type": "Sensor",
|
"type": "Sensor",
|
||||||
|
@ -311,6 +311,52 @@
|
|||||||
'state': 'on',
|
'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]
|
# name: test_states[switch.my_device_smooth_transitions-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user