feat(sensor): add "last clean result" sensor#53
Draft
jgus wants to merge 2 commits into
Draft
Conversation
…gnostics
Decoded the full RobotBaseStatus proto and corrected mislabeled fields
parsed into state: battery_health→curingAgentConsumptionPercent (f38),
session_id→bindedUuid (f13), timestamp→stationBagHealthResetTime (f36),
upgrade status (read f2, not f4=stage), download state (read f3, not
f1=type); BaseStatusField/UpgradeStatusField enums corrected to match.
Added diagnostics from fields the robot already broadcasts:
- sensors: dust bag health (f35), detergent remaining (f41)
- binary_sensors (problem, field-gated): error/fault (f1, exposing
code/level/detail + a best-effort help-center link), clean-water and
sewage tanks, dust box, dust bag, station dust bag
Binary sensors are now description-driven; ha_stubs gains the
BinarySensorEntityDescription stub for the new tests.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Surface base_status field 15 (terminateReason) as an enum sensor mapping the decoded TaskResult values to readable outcomes (Completed, Ended (low battery), Stopped by user, …) — i.e. why the last task ended. Live- confirmed: f15=1 → NORMAL_END. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Surfaces
base_statusfield 15 (terminateReason) as an enum sensor thatexplains why the last task ended — Completed, Ended (low battery), Stopped by
user, etc. — mapping the decoded
TaskResultvalues to readable states.Depends on #52
Builds on the corrected
update_from_base_statusfrom #52. Review/merge thatfirst; this branch is based on it (will rebase onto
masteronce it lands).How it was derived
TaskResultvalues from the app's decoded enum; live-confirmed f15=1 →NORMAL_END.Testing
tests/test_models.pyupdated; suite green.Relates to