feat: Q10 (B01/ss07) clean-record history trait#857
Conversation
80994f3 to
80b0bd6
Compare
allenporter
left a comment
There was a problem hiding this comment.
Thank you @andrewlyeats this is fantastic. I have some code structure related comments, though overall look forward to merging this feature.
Q10 clean history is push-driven over dpCleanRecord (DP 52), unlike the Q7's
synchronous get_record_list RPC. Adds:
- Q10CleanRecord: parses the 12-field op:list underscore string (raw retained),
with crash-safe enum accessors .scope/.work/.result/.started_by (IntEnums that
return None for an unmapped code, never raising like the YX from_code path)
- CleanHistoryTrait: refresh() sends {op:list}; update_from_dps decodes both the
full list and the single op:notify clean-finished push (upsert by record_id,
newest-first); registered as a read-model trait in the dispatch loop
Field layout is the device app's own (setHoldData), cross-confirmed by ioBroker's
Q10CleanRecordService. Tests cover decode, enum labels + unmapped-safety, and the
list/notify paths.
80b0bd6 to
8055598
Compare
|
Thanks — addressed all five, pushed. Enums:
Fields/converters: enums directly, property layer gone. Conversion runs in the converter via Structure: Docs/tests: dropped the app mention; added These "contributions" (I hope they are!) have been a collaboration between a physicist trying to learn about modern coding tools and one of those tools, Claude Code. We both hope our efforts to be gracious and follow open source software etiquette are apparent in our contributions here. If we are in fact injecting noise, please tell us and we will stop! We thank you for your work on this repo! |
allenporter
left a comment
There was a problem hiding this comment.
Can you explicitly address / reply / resolve each comments so we know they're completed? (or ask the AI to do it)
Co-authored-by: Allen Porter <allen.porter@gmail.com>
parse_record is a @staticmethod, so call it as CleanRecordConverter.parse_record(...) rather than self.parse_record(...).
ec279ef to
d552028
Compare
|
Replied to all comments in their respective threads and closed them out. Made both changes you suggested. Two of my commit messages didn't pass commit-message lint so had to force-push to correct. That force-push should not have changed any code, just the messages. I think this should now be resolved and ready for you. Thanks for your guidance! |
|
Thank you @andrewlyeats for the contribution! |
Implements #767 for B01/ss07 (Q10).
Adds a
CleanHistoryTraitthat fetches and decodes the Q10 clean-record history. Unlike the Q7's synchronousget_record_listRPC, the Q10 is push-driven:refresh()sends{"op":"list"}fordpCleanRecord(DP 52) overdpCommon, and the device publishes its record list back on the subscribe stream.Shape
CleanRecordConverterparses adpCleanRecordenvelope — the fullop:"list"reply or a singleop:"notify"push — into aCleanRecordPush; the trait's_applydoes the merge-or-replace, one sort, one notify.Q10CleanRecord(12 underscore fields), withclean_mode/work_mode/cleaning_result/start_methodtyped as enums viafrom_code_optional(an unmapped code →None; the original stays inraw).Validation (real ss07 Q10, fw 03.11.24)
op:"list"decoded 25 records live on the device's own reply topic; the end-of-cleanop:"notify"push was captured on a genuine whole-apartment completion and upserted correctly.Q10CleanRecordService(independent implementation).tests/protocols/testdata/b01_q10_protocol/.Caveats (one device observed)
clean_mode=2andstart_method=0were never seen on our unit — left unmapped rather than guessed (they surface asNone;rawretains the value).work_modeusesYXCleanType(matchingQ10Status); it caps at 4 while the liveCLEAN_MODEDP can reach 6, though records only ever show 1/2/3.map_lengate) is intentionally out of scope — a natural follow-up.