Drop translations from the Sofar coordinator errors (#181221)

This commit is contained in:
darkrain-nl
2026-09-03 21:09:36 +02:00
committed by GitHub
parent 7edac8b130
commit 3aae3b4ea7
3 changed files with 3 additions and 6 deletions
@@ -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
+2 -2
View File
@@ -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}."
+1 -1
View File
@@ -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))