plug.py 287 B

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