Skip to content

Commit

Permalink
Add more supported models (#1292)
Browse files Browse the repository at this point in the history
* dreamevacuum: add dreame.vacuum.mc1808 as supported

* airqualitymonitor_miot: add cgllc.airm.cgdn1 to supported models

* Make flake8 happy
  • Loading branch information
rytilahti authored Jan 10, 2022
1 parent 0558c63 commit 069bee8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions miio/airqualitymonitor_miot.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ class AirQualityMonitorCGDN1(MiotDevice):
"""Qingping Air Monitor Lite."""

mapping = _MAPPING_CGDN1
_supported_models = [MODEL_AIRQUALITYMONITOR_CGDN1]

@command(
default_output=format_output(
Expand Down
1 change: 1 addition & 0 deletions miio/integrations/vacuum/dreame/dreamevacuum_miot.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ class DreameVacuumMiot(MiotDevice):
"""Interface for Vacuum 1C STYTJ01ZHM (dreame.vacuum.mc1808)"""

mapping = _MAPPING
_supported_models = ["dreame.vacuum.mc1808"]

@command(
default_output=format_output(
Expand Down
5 changes: 1 addition & 4 deletions miio/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,7 @@ def get_length(x) -> int:
def is_hello(x) -> bool:
"""Return if packet is a hello packet."""
# not very nice, but we know that hellos are 32b of length
if "length" in x:
val = x["length"]
else:
val = x.header.value["length"]
val = x.get("length", x.header.value["length"])

return bool(val == 32)

Expand Down

0 comments on commit 069bee8

Please sign in to comment.