Skip to content

Add LG PuriCare water purifier 1WPU4CIGCR__2 (stateless) - #118

Open
tunarabuuu wants to merge 1 commit into
anszom:masterfrom
tunarabuuu:dev-purifier
Open

Add LG PuriCare water purifier 1WPU4CIGCR__2 (stateless)#118
tunarabuuu wants to merge 1 commit into
anszom:masterfrom
tunarabuuu:dev-purifier

Conversation

@tunarabuuu

Copy link
Copy Markdown
Contributor

Sixth and last of the per-device-class splits from #111.

1WPU4CIGCR__2 — an AA..BB ThinQ2 water purifier (deviceType 103), driven through LG's capability API (the read map doubles as the write map). The sterilization reservation stays read-only: a time-only write moves the appliance's weekly day anchor and LG's schema can't preserve it.

Addressing your review notes from #111:

  • stateless — no persistent history in rethink. State and the raw reservation are published straight from each frame. Dispense volumes arrive as per-report deltas, which the driver sums into a monotonic in-memory counter (reset to zero on restart) published as total_increasing, so HA does the accumulation exactly as it does for energy meters. The whole purifier-history-store module, the day-rollover/midnight timers, the persisted sterilization schedule, and the "last month count / last sterilize" entities are gone.
  • processAABB — reads go through the base class's processAABB now (offsets need no whole-frame adjustment).
  • time / KST — dropped entirely; the reservation is published raw as month.day HH:MM, no timezone conversion.
  • logging utilityconsole.warn calls now use log(...).
  • header comment / test-only helpers — trimmed the header, and the test file is rewritten around the stateless behaviour.

The driver drops from ~1030 lines to ~330. All labels are English. npm test passes; tsc clean.

This completes the split; I'll close #111 and link all six here.

An AA..BB ThinQ2 water purifier (deviceType 103), driven through LG's
capability API. The read map doubles as the write map; the sterilization
reservation stays read-only because a time-only write moves the appliance's
weekly day anchor and LG's schema can't preserve it.

Stateless per review: no persistent history in rethink. State and the raw
reservation are published straight from each frame; dispense volumes arrive as
per-report deltas and are summed into a monotonic counter (reset to zero on
restart) published as total_increasing, so Home Assistant does the
accumulation the way it already does for energy meters. Reads go through the
base class's processAABB; warnings use the logging utility.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant