Yeedi vacuum MQTT integration for Home Assistant
Find a file
yeedi-worker 8a0896af0f
Some checks failed
CI / lint (push) Failing after 26s
feat: polished entity platforms (sensor, button, select, switch)
Implements the Node-RED Tomschin flow spec (docs/spec/reverse_engineered_spec.yaml)
as native Home Assistant entity platforms. Each platform subscribes
directly to the deebot_client event bus — no polling, no home-grown
auth, no mocked HA base classes.

- yeedi/sensor.py: 17 sensors (battery, last cleaning time, charge
  state, sleep state, water box, last error, clean speed, water level,
  3 lifespan, 4 info + 1 static)
- yeedi/button.py: 4 buttons (Start, Return to dock, Pause, Find me).
  MoveBackward is dropped — deebot_client doesn't ship that command.
- yeedi/select.py: 2 selects (water level via SetWaterInfo, clean
  speed via SetFanSpeed)
- yeedi/switch.py: 1 switch (do-not-disturb). deebot_client v11 has
  no DoNotDisturbEnabled event; we map it to ContinuousCleaningEvent
  as the closest available signal. The switch preserves both the
  v6 'enable' and v11 'enabled' field names via getattr fallback.

Test infrastructure overhaul:
- tests/conftest.py: dropped the entire homeassistant mock tree
  (~250 lines of sys.modules spoofing). Tests now run against the
  real homeassistant 2025.1 base classes installed in the venv.
- tests/_support/test_event_bus.py: a minimal in-test event bus
  compatible with the deebot_client v11 EventBus surface
  (subscribe + notify). v11's EventBus requires a Device; the
  test version is just a pub-sub.
- tests/test_polished_entities.py: 14 tests covering all four
  platforms.

Source fixes surfaced by removing the mocks:
- yeedi/services.py: pre-existing use of cv.Required / cv.Optional /
  cv.make_entity_service_schema was removed in HA 2025.1; switched
  to voluptuous.vol.Schema + vol.Required + vol.Optional.
- yeedi/vacuum.py: AddConfigEntryEntitiesCallback was renamed
  AddEntitiesCallback in HA 2025.1; fixed. Also gated
  VacuumEntityFeature.CLEAN_AREA on hasattr because that constant
  was removed in 2025.1.

docs/spec/: the 5 spec YAML files copied in from the prior
yeedi_awmbuild research so the spec lives where the code does.

Test count: 114 passed, 0 failed (was: 105 with mocks, 27 broken
without them).
2026-10-12 13:52:18 -07:00
.forgejo/workflows fix(ci): self-contained workflow — drop unreachable JS actions 2026-09-16 08:55:28 -07:00
docs/spec feat: polished entity platforms (sensor, button, select, switch) 2026-10-12 13:52:18 -07:00
tests feat: polished entity platforms (sensor, button, select, switch) 2026-10-12 13:52:18 -07:00
yeedi feat: polished entity platforms (sensor, button, select, switch) 2026-10-12 13:52:18 -07:00
.gitignore gsd: pre-implementation lint/format cleanup 2026-05-16 03:56:26 -07:00
.pre-commit-config.yaml chore: add basic pre-commit hooks (trailing-whitespace, eof-fixer, ruff) 2026-06-03 17:29:41 -07:00
requirements.txt fix: address issues #3, #4, #5, #6 — wire up MQTT cert verification, create requirements.txt, align error keys, deduplicate constants 2026-05-11 08:59:45 -07:00