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 support for all Huizuo Lamps (w/ fans, heaters, and scenes) #881

Merged
merged 32 commits into from
Jan 20, 2021
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fcf6da0
Adding Huizuo basic support
darckly Nov 25, 2020
a070d06
Add huizuo.py to the repo
darckly Nov 25, 2020
76ba1db
Update __init__.py to the latest version
darckly Nov 25, 2020
881a073
Fix _LOGGER error
darckly Nov 25, 2020
1027fe1
Enabling iSort in VSCode on Save
darckly Nov 25, 2020
6568772
1. Removed unnecessary click.argument calls
darckly Nov 25, 2020
f24749f
1. Removed Huizuo from discovery - devices are not mdns discoverable
darckly Nov 25, 2020
98e9522
Re-arranged color_temp parameter for better understanding
darckly Nov 25, 2020
6d451a8
fixing linting issues
darckly Nov 25, 2020
451a65a
Added only example of JSON payload from the lamp
darckly Nov 25, 2020
5599e05
Updated README.rst, added separations
darckly Nov 26, 2020
70c64ac
1. Use MiotDevice class
darckly Nov 27, 2020
dbef460
Fixing linting issues
darckly Nov 27, 2020
abf6d25
Fixing linting issue - second try...
darckly Nov 27, 2020
99d71e0
Processing comments from PR#868
darckly Nov 27, 2020
4c52df5
Updated the list of devices, updated status
darckly Nov 29, 2020
91572a9
fix wrong dict concatenation
darckly Nov 29, 2020
4ac12ff
Dict concat fix 2
darckly Nov 29, 2020
4b37810
Update mapping and status output
darckly Dec 1, 2020
dc66d6c
Fix status issue
darckly Dec 1, 2020
5796edc
is_fan_reverse update
darckly Dec 1, 2020
a6cc475
Added fan, heater, scene supports
darckly Dec 2, 2020
b9c3f86
Updated unit test
darckly Dec 3, 2020
b2f54e7
Update README.rst
darckly Dec 3, 2020
0683ac4
Merge remote-tracking branch 'upstream/master'
darckly Dec 3, 2020
560d22b
Split by classes
darckly Dec 4, 2020
27720e6
Cut the basic status for lamp
darckly Dec 4, 2020
e83d963
pre-commit
darckly Dec 4, 2020
4f277a3
Processing suggestions from PR#881
darckly Dec 28, 2020
89ae6b0
Change the function name in scene management (request from PR #881)
darckly Jan 8, 2021
078af50
Typo fix
darckly Jan 8, 2021
e334bd9
Simplifying code (removing unnecessary 'else' statements)
darckly Jan 9, 2021
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
12 changes: 6 additions & 6 deletions miio/huizuo.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@
"colortemp_add": {"siid": 3, "piid": 5},
"colortemp_dec": {"siid": 3, "piid": 6},
"colortemp_switch": {"siid": 3, "piid": 7},
"on_or_brightness": {"siid": 3, "piid": 8},
"on_or_colortemp": {"siid": 3, "piid": 9},
"on_or_increasbrightness": {"siid": 3, "piid": 8},
rytilahti marked this conversation as resolved.
Show resolved Hide resolved
"on_or_increase_colortemp": {"siid": 3, "piid": 9},
}


Expand Down Expand Up @@ -580,19 +580,19 @@ def colortemp_switch(self):
@command(
default_output=format_output("Switch on or increase brightness"),
)
def on_or_brightness(self):
def on_or_increase_brightness(self):
"""Switch on or increase brightness (only for models with scenes support)."""
if self.model in MODELS_WITH_SCENES:
return self.set_property("on_or_brightness", 0)
return self.set_property("on_or_increase_brightness", 0)
else:
raise HuizuoException("Your device doesn't support scenes")

@command(
default_output=format_output("Switch on or increase color temperature"),
)
def on_or_colortemp(self):
def on_or_increase_colortemp(self):
"""Switch on or increase color temperature (only for models with scenes support)."""
if self.model in MODELS_WITH_SCENES:
return self.set_property("on_or_colortemp", 0)
return self.set_property("on_or_increase_colortemp", 0)
else:
raise HuizuoException("Your device doesn't support scenes")