feat(sensor): poll consumable maintenance/replacement alerts#54
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>
Add a periodic consumable/get_consumable_info query (at startup and every ~30 min) and expose maintainItems/replaceItems as two problem binary_sensors, with the specific parts (mop, dust bag, side brush, …) listed in an `items` attribute. Per-part life % is cloud-only and not available on the LAN protocol, so these alert lists are what the robot exposes locally. 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
Adds a periodic
consumable/get_consumable_infoquery (at startup, then every~30 min) and exposes the robot's
maintainItems/replaceItemsas twoproblembinary sensors. The specific parts (mop, dust bag, side brush, …) arelisted in an
itemsattribute.Per-part life percentages are cloud-only and not available over the LAN protocol,
so these alert lists are what the robot exposes locally — but they're enough to
drive "time to clean/replace X" notifications.
Depends on #52
Uses the description-driven binary-sensor framework introduced in #52. Review/merge
that first; this branch is based on it (will rebase onto
masteronce it lands).Testing
tests/test_binary_sensor.py,test_models.py,test_coordinator.pyupdated;suite green.
Relates to