diff --git a/homeassistant/components/sofar/coordinator.py b/homeassistant/components/sofar/coordinator.py index 5ac7ad51e89b..200743c0b1ed 100644 --- a/homeassistant/components/sofar/coordinator.py +++ b/homeassistant/components/sofar/coordinator.py @@ -73,12 +73,10 @@ class SofarDataUpdateCoordinator(DataUpdateCoordinator[UpdateReport]): raise UpdateFailed( translation_domain=DOMAIN, translation_key="no_component_answered", - translation_placeholders={"name": self.name}, ) raise UpdateFailed( translation_domain=DOMAIN, translation_key="no_component_answered", - translation_placeholders={"name": self.name}, ) from ExceptionGroup("all components failed to refresh", errors) except ModbusError as err: # ModbusConnectionError (dead link) and ModbusTimeoutError reach @@ -86,7 +84,6 @@ class SofarDataUpdateCoordinator(DataUpdateCoordinator[UpdateReport]): raise UpdateFailed( translation_domain=DOMAIN, translation_key="modbus_error", - translation_placeholders={"error": str(err)}, ) from err else: return report diff --git a/homeassistant/components/sofar/strings.json b/homeassistant/components/sofar/strings.json index a9603df09458..a9822f170a70 100644 --- a/homeassistant/components/sofar/strings.json +++ b/homeassistant/components/sofar/strings.json @@ -612,10 +612,10 @@ "message": "Maximum power must be a multiple of 100 W." }, "modbus_error": { - "message": "{error}" + "message": "Error communicating with the inverter." }, "no_component_answered": { - "message": "{name}: no component answered." + "message": "No component answered." }, "unrecognized_inverter_model": { "message": "Unrecognized Sofar inverter model for {title}." diff --git a/tests/components/sofar/test_init.py b/tests/components/sofar/test_init.py index d956782289f5..f48148ab87c5 100644 --- a/tests/components/sofar/test_init.py +++ b/tests/components/sofar/test_init.py @@ -346,7 +346,7 @@ async def test_every_component_failing_recovers_on_a_later_poll( assert hass.states.get(entity_id).state == STATE_UNAVAILABLE # Availability alone cannot tell a failed poll from one that reported # every component as failed; only the logged error separates them. - assert "no component answered" in caplog.text + assert "No component answered" in caplog.text mock_connection.for_unit(1).fail_requests(None) freezer.tick(timedelta(seconds=SCAN_INTERVAL))