Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more supported models #1292

Merged
merged 3 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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