humidifier.py 664 B

123456789101112131415161718192021222324252627
  1. """Humidifier adv parser."""
  2. from __future__ import annotations
  3. import logging
  4. _LOGGER = logging.getLogger(__name__)
  5. # mfr_data: 943cc68d3d2e
  6. # data: 650000cd802b6300
  7. # data: 650000cd802b6300
  8. # data: 658000c9802b6300
  9. # Low: 658000c5222b6300
  10. # Med: 658000c5432b6300
  11. # High: 658000c5642b6300
  12. def process_wohumidifier(data: bytes, mfr_data: bytes | None) -> dict[str, bool | int]:
  13. """Process WoHumi services data."""
  14. if mfr_data is None:
  15. return {}
  16. _LOGGER.debug("mfr_data: %s", mfr_data.hex())
  17. _LOGGER.debug("data: %s", data.hex())
  18. return {
  19. "isOn": bool(data[1]),
  20. "level": data[4],
  21. "switchMode": True,
  22. }