Repository navigation
Conversation
Surface the base station's error codes (content.error on onStationState, shared by the getStationState poll) as a dedicated event. It is emitted before the activity-state parse so an unrecognised frame cannot swallow a fault, and an absent or unusable error field is ignored rather than treated as an all-clear. Add an optional CapabilityStation.error field so a profile can declare the refresh command. Tests cover push and poll, an empty list, an omitted field, an unrecognised activity state, and mixed/unusable entries.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some docks report water-tank and other base-station faults on the station's own
errorchannel rather than throughErrorEvent/getError. The library currently drops that field (OnStationStatereads onlystate/content.type/content.motionState), so the signal is invisible to consumers.This adds a dedicated
StationErrorEventcarrying the error-code tuple, notified from the existingOnStationStatehandler.GetStationStatesubclasses it, so one event covers both the push and the poll.ErrorEventis left untouched, so the two sources cannot clobber each other.Details:
StationErrorEvent(errors: tuple[int, ...]); an empty tuple means the station reported an empty error list.type/motionStatecannot swallow a fault.errorfield is ignored (the last known value is preserved) rather than read as an all-clear; non-integer entries inside a list are skipped.CapabilityStation.error: CapabilityEvent[StationErrorEvent] | None, so a profile can declare its own refresh command. No profile is wired here — that follows separately, per the split-PR convention.Evidence — DEEBOT X1 OMNI, class
1vxt52, modelEINSTEIN_INT, UILogicIdt10_ww_n_omni. While the clean tank was low, the robot error channel read 0 while the station channel reported 301 ("FreshWaterBox empty"); 314 is the expected "water/silver module not installed" on this container-based model, not a fault:Tests cover push and poll:
[301,314], an empty list, an omitted field, an unrecognised activity state carrying errors, string codes, and non-list / all-unusable lists.tests/test_capabilities.pychecks the new capability field is extractable as a refresh command.Caveat: the poll path is unproven for this device — every captured
getStationStatereturned[314], and the only301arrived on a push. Since the event is a replacement snapshot, a poll taken while the tank is low may be less informative; that needs a live capture before a consumer relies on polling. Nothing here wires a profile.Related: #1808, home-assistant/core#181667.