plug.py 322 B

1234567891011
  1. """Library to handle connection with Switchbot."""
  2. from __future__ import annotations
  3. def process_woplugmini(data: bytes, mfr_data: bytes | None) -> dict[str, bool | int]:
  4. """Process plug mini."""
  5. return {
  6. "switchMode": True,
  7. "isOn": mfr_data[7] == 0x80,
  8. "wifi_rssi": -mfr_data[9],
  9. }