Add child lock for tplink thermostats (#129649)

pull/129881/head
Teemu R. 2024-11-05 11:14:53 +01:00 committed by GitHub
parent 8889464e04
commit 72bcc6702f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 60 additions and 0 deletions

View File

@ -68,6 +68,9 @@
"state": {
"on": "mdi:sleep"
}
},
"child_lock": {
"default": "mdi:account-lock"
}
},
"sensor": {

View File

@ -190,6 +190,9 @@
},
"fan_sleep_mode": {
"name": "Fan sleep mode"
},
"child_lock": {
"name": "Child lock"
}
},
"number": {

View File

@ -48,6 +48,9 @@ SWITCH_DESCRIPTIONS: tuple[TPLinkSwitchEntityDescription, ...] = (
TPLinkSwitchEntityDescription(
key="fan_sleep_mode",
),
TPLinkSwitchEntityDescription(
key="child_lock",
),
)
SWITCH_DESCRIPTIONS_MAP = {desc.key: desc for desc in SWITCH_DESCRIPTIONS}

View File

@ -34,6 +34,11 @@
"type": "Switch",
"category": "Config"
},
"child_lock": {
"value": true,
"type": "Switch",
"category": "Config"
},
"current_consumption": {
"value": 5.23,
"type": "Sensor",

View File

@ -173,6 +173,52 @@
'state': 'on',
})
# ---
# name: test_states[switch.my_device_child_lock-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_child_lock',
'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': 'Child lock',
'platform': 'tplink',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'child_lock',
'unique_id': '123456789ABCDEFGH_child_lock',
'unit_of_measurement': None,
})
# ---
# name: test_states[switch.my_device_child_lock-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'my_device Child lock',
}),
'context': <ANY>,
'entity_id': 'switch.my_device_child_lock',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_states[switch.my_device_fan_sleep_mode-entry]
EntityRegistryEntrySnapshot({
'aliases': set({