Browse Source

Add plug mini power field (#142)

Masahiro Konishi 1 year ago
parent
commit
bd614c3573
1 changed files with 1 additions and 0 deletions
  1. 1 0
      switchbot/adv_parsers/plug.py

+ 1 - 0
switchbot/adv_parsers/plug.py

@@ -10,4 +10,5 @@ def process_woplugmini(data: bytes, mfr_data: bytes | None) -> dict[str, bool |
         "switchMode": True,
         "isOn": mfr_data[7] == 0x80,
         "wifi_rssi": -mfr_data[9],
+        "power": ( ( ( mfr_data[10] << 8 ) + mfr_data[11] ) & 0x7fff ) / 10  # W
     }