mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Add new button to the Lektrico integration (#145420)
This commit is contained in:
parent
d48ca1d858
commit
e410977e64
@ -39,6 +39,12 @@ BUTTONS_FOR_CHARGERS: tuple[LektricoButtonEntityDescription, ...] = (
|
|||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
press_fn=lambda device: device.send_charge_stop(),
|
press_fn=lambda device: device.send_charge_stop(),
|
||||||
),
|
),
|
||||||
|
LektricoButtonEntityDescription(
|
||||||
|
key="charging_schedule_override",
|
||||||
|
translation_key="charging_schedule_override",
|
||||||
|
entity_category=EntityCategory.CONFIG,
|
||||||
|
press_fn=lambda device: device.send_charge_schedule_override(),
|
||||||
|
),
|
||||||
LektricoButtonEntityDescription(
|
LektricoButtonEntityDescription(
|
||||||
key="reboot",
|
key="reboot",
|
||||||
device_class=ButtonDeviceClass.RESTART,
|
device_class=ButtonDeviceClass.RESTART,
|
||||||
|
@ -60,6 +60,9 @@
|
|||||||
},
|
},
|
||||||
"charge_stop": {
|
"charge_stop": {
|
||||||
"name": "Charge stop"
|
"name": "Charge stop"
|
||||||
|
},
|
||||||
|
"charging_schedule_override": {
|
||||||
|
"name": "Charging schedule override"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"number": {
|
"number": {
|
||||||
|
@ -93,6 +93,53 @@
|
|||||||
'state': 'unknown',
|
'state': 'unknown',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_all_entities[button.1p7k_500006_charging_schedule_override-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'button',
|
||||||
|
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||||
|
'entity_id': 'button.1p7k_500006_charging_schedule_override',
|
||||||
|
'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': 'Charging schedule override',
|
||||||
|
'platform': 'lektrico',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'charging_schedule_override',
|
||||||
|
'unique_id': '500006-charging_schedule_override',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_all_entities[button.1p7k_500006_charging_schedule_override-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': '1p7k_500006 Charging schedule override',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'button.1p7k_500006_charging_schedule_override',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'unknown',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_all_entities[button.1p7k_500006_restart-entry]
|
# name: test_all_entities[button.1p7k_500006_restart-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user