diff --git a/homeassistant/components/google_assistant/button.py b/homeassistant/components/google_assistant/button.py index 415531214c5..47681308b53 100644 --- a/homeassistant/components/google_assistant/button.py +++ b/homeassistant/components/google_assistant/button.py @@ -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.""" diff --git a/homeassistant/components/google_assistant/strings.json b/homeassistant/components/google_assistant/strings.json index cb01a0febf5..8ef77f8d8c3 100644 --- a/homeassistant/components/google_assistant/strings.json +++ b/homeassistant/components/google_assistant/strings.json @@ -1,4 +1,11 @@ { + "entity": { + "button": { + "sync_devices": { + "name": "Synchronize devices" + } + } + }, "services": { "request_sync": { "name": "Request sync", diff --git a/tests/components/google_assistant/test_button.py b/tests/components/google_assistant/test_button.py index d16d406999e..d3c5665b945 100644 --- a/tests/components/google_assistant/test_button.py +++ b/tests/components/google_assistant/test_button.py @@ -24,7 +24,7 @@ async def test_sync_button(hass: HomeAssistant, hass_owner_user: MockUser) -> No await hass.async_block_till_done() - state = hass.states.get("button.synchronize_devices") + state = hass.states.get("button.google_assistant_synchronize_devices") assert state config_entry = hass.config_entries.async_entries("google_assistant")[0] @@ -36,7 +36,7 @@ async def test_sync_button(hass: HomeAssistant, hass_owner_user: MockUser) -> No await hass.services.async_call( "button", "press", - {"entity_id": "button.synchronize_devices"}, + {"entity_id": "button.google_assistant_synchronize_devices"}, blocking=True, context=context, ) @@ -48,7 +48,7 @@ async def test_sync_button(hass: HomeAssistant, hass_owner_user: MockUser) -> No await hass.services.async_call( "button", "press", - {"entity_id": "button.synchronize_devices"}, + {"entity_id": "button.google_assistant_synchronize_devices"}, blocking=True, context=context, )