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

yeelight: use and expose the color temp range from specs #1247

Merged
merged 7 commits into from
Dec 17, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix black
Kirmas committed Dec 13, 2021
commit a271ce7f41e46067e97f874cbce08c3681f77275
4 changes: 3 additions & 1 deletion miio/integrations/yeelight/__init__.py
Original file line number Diff line number Diff line change
@@ -363,7 +363,9 @@ def set_brightness(self, level, transition=0):
)
def set_color_temp(self, level, transition=500):
"""Set color temp in kelvin."""
color_temp = self._model_info.lamps[YeelightSubLightType.Main].color_temp #for now only main light support
color_temp = self._model_info.lamps[
YeelightSubLightType.Main
].color_temp # for now only main light support
rytilahti marked this conversation as resolved.
Show resolved Hide resolved
if level > color_temp.max or level < color_temp.min:
raise YeelightException("Invalid color temperature: %s" % level)
if transition > 0: