-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 Mi Desk Lamp #4887
Conversation
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.
The uint16_t rotary_debounce;
could be uint8_t rotary_debounce;
as it is unlikely that you would need a debounce of more than 255ms on a rotary encoder.
Also, @arendst will need to decide if the rotary support should be in a separate driver file or not so that it may be conditionally included or excluded for wider use cases where users just want to use a rotary encoder with any other project.
Would be cool to see a separate general rotary driver for Tasmota |
Is there any particular reason why "Control color temperature with button press & rotary switch" is not included in your initial PR ? |
@andrethomas I've used |
@andrethomas Because I'm not a developer, I'd like to start the review process as soon as possible to taylor any coding style problems... |
Have you looked here? |
@Jason2866 I used https://github.com/Torxgewinde/Desk-Lamp-Alternative-Firmware for the start, then (as I mentioned in the code), I used the Encoder library for decoding the rotary switch. |
In the future we might have to move the device specific code elsewhere but for now it can stay where it is. To make things simpler I would like to get rid of the special rotary debounce code and use the key debounce instead. I do not expect deviations between the two. Have a separate handler for the rotary switch is also a good idea for now as it allows changes to be kept to this file only. For double press you might find some hints in the button.ino file. |
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.
See my last comment
@arendst Did you think about something like my last commit? |
Yes. |
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.
Happy for the moment, so just need to see how @arendst wants to proceed.
I think the initial state of the rotary can also be pushed by home automation software, but may not be necessary.
I've added the color temperature change feature.
|
Move rotary GPIO to non-user config for now.
Add support for Mi Desk Lamp
6.4.1.9 20190115 * Add support for Mi LED Desk Lamp with rotary switch (arendst#4887) * Fix mDNS addService (arendst#4938)
Hi,
This is my initial commit for Mi Desk Lamp... It's WIP, no color temperature switch yet...
I'd like to add it for review, because I'm pretty sure, that you have coding standards, recommendations, etc, that I need to modify...
Status:
Any reviews or suggestions are welcome