Tidy transport, commands and firmware error handling #96
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/transport-commands-hygiene"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Five small hygiene fixes, one commit each:
BusUnavailableErrornow subclassesHomeAssistantError, so the four callers that caught and re-raised it are gone.InstallOutcomegets atookproperty, replacing theTOOK/TOOK_THE_IMAGEfrozenset duplicated acrossupdate.pyandservices.pybecause of an import cycle.UpdaterClient.async_installandasync_flashshare one_sessionhelper.commands.py's four command methods share one_askhelper, andasync_switchcomputes its direction once instead of twice.presence.encode_versionis left alone:test_presence.pyimports it directly.No behavioural change;
tools/checkis green.9f26f5f5f90808aad6d9Scope, tests,
_ask/_session/tookplacement and the discovery.py/presence.py exclusions all check out.tools/checkis green here too (1221 passed). One thing worth a deliberate yes/no rather than letting it pass by default.@ -34,3 +34,4 @@class BusUnavailableError(HomeAssistantError):"""The bus is not carrying frames at the moment."""This is a genuine user-facing behaviour change, not just a hygiene refactor, even though it's the right call: the four dropped call sites used to raise entity/action-specific messages ("the command for {entity_id} was not sent", "the reboot for {entity_id} was not sent", "the mode was not broadcast", "the shutdown was not broadcast"). Now the user just sees
BusUnavailableError's own message, e.g. "can0 is not available" or "can0 refused the frame", with no mention of which action failed.The commit message acknowledges this ("since it already carries a usable message") so it's disclosed, not an oversight. But the PR description says "No behavioural change", and this is one - worth confirming that's an intentional trade (the HA toast is already tied to the action just taken, so the entity is usually obvious) rather than a message regression nobody meant to sign off on.