mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Add reboot button for tplink (#127935)
* Add reboot button for tplink * Add device_class, remove unnecessary translation and update fixtures * update snapshot
This commit is contained in:
parent
c39a1596d5
commit
64693eaca2
@ -9,6 +9,7 @@ from kasa import Feature
|
|||||||
|
|
||||||
from homeassistant.components.button import (
|
from homeassistant.components.button import (
|
||||||
DOMAIN as BUTTON_DOMAIN,
|
DOMAIN as BUTTON_DOMAIN,
|
||||||
|
ButtonDeviceClass,
|
||||||
ButtonEntity,
|
ButtonEntity,
|
||||||
ButtonEntityDescription,
|
ButtonEntityDescription,
|
||||||
)
|
)
|
||||||
@ -45,6 +46,10 @@ BUTTON_DESCRIPTIONS: Final = [
|
|||||||
breaks_in_ha_version="2025.4.0",
|
breaks_in_ha_version="2025.4.0",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
TPLinkButtonEntityDescription(
|
||||||
|
key="reboot",
|
||||||
|
device_class=ButtonDeviceClass.RESTART,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
BUTTON_DESCRIPTIONS_MAP = {desc.key: desc for desc in BUTTON_DESCRIPTIONS}
|
BUTTON_DESCRIPTIONS_MAP = {desc.key: desc for desc in BUTTON_DESCRIPTIONS}
|
||||||
|
@ -205,6 +205,11 @@
|
|||||||
"type": "BinarySensor",
|
"type": "BinarySensor",
|
||||||
"category": "Info"
|
"category": "Info"
|
||||||
},
|
},
|
||||||
|
"reboot": {
|
||||||
|
"value": "<Action>",
|
||||||
|
"type": "Action",
|
||||||
|
"category": "Debug"
|
||||||
|
},
|
||||||
"test_alarm": {
|
"test_alarm": {
|
||||||
"value": "<Action>",
|
"value": "<Action>",
|
||||||
"type": "Action",
|
"type": "Action",
|
||||||
|
@ -1,4 +1,37 @@
|
|||||||
# serializer version: 1
|
# serializer version: 1
|
||||||
|
# name: test_states[button.my_device_restart-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': <RegistryEntryDisabler.INTEGRATION: 'integration'>,
|
||||||
|
'domain': 'button',
|
||||||
|
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
|
||||||
|
'entity_id': 'button.my_device_restart',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <ButtonDeviceClass.RESTART: 'restart'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Restart',
|
||||||
|
'platform': 'tplink',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'reboot',
|
||||||
|
'unique_id': '123456789ABCDEFGH_reboot',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_states[button.my_device_stop_alarm-entry]
|
# name: test_states[button.my_device_stop_alarm-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user