-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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 yeelink.light.lamp1model to miio light platform (Mi LED Desk Lamp) #17699
Conversation
This model includes the Mi LED Desk Lamp (MJTD01YL)
Adds support for the Mi LED Desk Lamp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks generally okay to me, just a quick question, is this not controllable with the yeelight app / is it not possible to enable the lan mode from there for these?
Hi @dmacvicar, It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rytilahti I did not try as the app showed "Login" as the first screen.
However, after clicking it I realized it used the same Mi account, and I was able to turn the light into LAN mode.
It works perfectly with the Yeelight platform. Not sure if to laugh or if to cry 😄 😢 !
Perhaps I should just update the documentation to make things less confusing.
Should we just dismiss this PR and close it?. I don't know if this method of accessing the light helps anyone. Eg. in a country where the app is not available, but miio still can retrieve the token.
We should close this PR. :-) |
@dmacvicar Yeah, I suppose the documentation could use some help (also that of python-miio..), so any help is very welcome! I just created a PR to python-miio to at least expose the yeelight functionality a bit (assuming you have the token, you can also use python-miio to enable the developer/lan mode, no need for the yeelight app). |
Description:
After getting a Mi LED Desk Lamp (MJTD01YL), I was very lost on how to get it to work with home assistant. The lamp is controlled with the same app as the Mi Robot Vacuum, and talks to the cloud.
After recovering the token with the miio cli, I went to home assistant Yeelight component, but realized it does not take a token in the configuration. I went then to the miio component, and it failed because it was an unrecognized model (yeelink.light.lamp1)
I noticed python-miio has a yeelight device class, so I added a new light that uses this device to control the light. I also refactored the naming a bit to make it less tied to "Philips" in the base classes.
Example entry for
configuration.yaml
(if applicable):Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
New dependencies have been added to the.REQUIREMENTS
variable (example)New dependencies are only imported inside functions that use them (example).New or updated dependencies have been added to.requirements_all.txt
by runningscript/gen_requirements_all.py
New files were added to..coveragerc
If the code does not interact with devices:
Tests have been added to verify that the new code works.