mirror of
https://github.com/home-assistant/core.git
synced 2026-09-24 23:41:48 -05:00
Add Reolink time synchronization button (#177352)
This commit is contained in:
@@ -188,6 +188,14 @@ HOST_BUTTON_ENTITIES = (
|
||||
supported=lambda api: api.supported(None, "reboot"),
|
||||
method=lambda api: api.reboot(),
|
||||
),
|
||||
ReolinkHostButtonEntityDescription(
|
||||
key="sync_time",
|
||||
translation_key="sync_time",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
supported=lambda api: api.supported(None, "sync_time"),
|
||||
method=lambda api: api.baichuan.synchronize_time(),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -182,6 +182,9 @@
|
||||
},
|
||||
"ptz_zoom_out": {
|
||||
"default": "mdi:magnify"
|
||||
},
|
||||
"sync_time": {
|
||||
"default": "mdi:clock-outline"
|
||||
}
|
||||
},
|
||||
"light": {
|
||||
|
||||
@@ -244,6 +244,9 @@
|
||||
},
|
||||
"ptz_zoom_out": {
|
||||
"name": "PTZ zoom out"
|
||||
},
|
||||
"sync_time": {
|
||||
"name": "Synchronize time"
|
||||
}
|
||||
},
|
||||
"camera": {
|
||||
|
||||
@@ -912,3 +912,53 @@
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[button.test_reolink_name_synchronize_time-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'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.test_reolink_name_synchronize_time',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Synchronize time',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Synchronize time',
|
||||
'platform': 'reolink',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'sync_time',
|
||||
'unique_id': 'ABC1234567D89EFG_sync_time',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[button.test_reolink_name_synchronize_time-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'test_reolink_name Synchronize time',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'button.test_reolink_name_synchronize_time',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
|
||||
Reference in New Issue
Block a user