Migrate google assistant to has entity name (#96593)
* Migrate google assistant to has entity name * Fix tests * Add device name * Update homeassistant/components/google_assistant/button.py Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io> --------- Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
7ec506907c
commit
28540b0cb2
3 changed files with 17 additions and 5 deletions
|
@ -34,14 +34,19 @@ async def async_setup_entry(
|
|||
class SyncButton(ButtonEntity):
|
||||
"""Representation of a synchronization button."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
_attr_translation_key = "sync_devices"
|
||||
|
||||
def __init__(self, project_id: str, google_config: GoogleConfig) -> None:
|
||||
"""Initialize button."""
|
||||
super().__init__()
|
||||
self._google_config = google_config
|
||||
self._attr_entity_category = EntityCategory.DIAGNOSTIC
|
||||
self._attr_unique_id = f"{project_id}_sync"
|
||||
self._attr_name = "Synchronize Devices"
|
||||
self._attr_device_info = DeviceInfo(identifiers={(DOMAIN, project_id)})
|
||||
self._attr_device_info = DeviceInfo(
|
||||
identifiers={(DOMAIN, project_id)},
|
||||
name="Google Assistant",
|
||||
)
|
||||
|
||||
async def async_press(self) -> None:
|
||||
"""Press the button."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue