浏览代码

fix: crash on checking humidifier adv (#125)

J. Nick Koston 2 年之前
父节点
当前提交
1413c1f8c2
共有 1 个文件被更改,包括 2 次插入1 次删除
  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())