Browse Source

fix: crash on checking humidifier adv (#125)

J. Nick Koston 2 years ago
parent
commit
1413c1f8c2
1 changed files with 2 additions and 1 deletions
  1. 2 1
      switchbot/adv_parsers/humidifier.py

+ 2 - 1
switchbot/adv_parsers/humidifier.py

@@ -15,7 +15,8 @@ _LOGGER = logging.getLogger(__name__)
 # High: 658000c5642b6300
 def process_wohumidifier(data: bytes, mfr_data: bytes | None) -> dict[str, bool | int]:
     """Process WoHumi services data."""
-    assert mfr_data is not None
+    if mfr_data is None:
+        return {}
     _LOGGER.debug("mfr_data: %s", mfr_data.hex())
     _LOGGER.debug("data: %s", data.hex())