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 SM2235 and SM2335 LED drivers #3924
Conversation
Hey there @Cossid, CODEOWNERS = ["@Cossid"] And run (message by NeedsCodeownersLabel) |
To the best of my understanding, all remaining CI failures are unrelated to changes made by this PR. |
Other than the trivial setters, move the function contents to the |
Yeah, I started with SM2135 as a base, but that does seem poorly written. SM2135 needs some work too, but it will require breaking changes. I will likely address that driver in the future as I work on a few other LED drivers. @ssieb I have adjusted this driver to closer emulate the my9231 driver header/source structure, please re-review that this meets expectations. |
Just adding a note that there was a request for a SM2235 driver on discord, which looks like it shares the majority of code with the 2335 driver. I have created a fork branch named sm_1024bit_base which shares as much code as I was able to, and pending feedback from users with sm2235 drivers, this PR may end up abandoned in favor of that one which supports both SM2235 and SM2335. If this one is merged, it should be a non-breaking change to the other branch. |
After further review, the underscore is only used in the component directory name and namespace, renamed class to match linter expectations. |
Just wanted to add that I used this branch to compile firmware for my Switchbot RGB+CT E26 W1401400 bulb (ESP32-C3), and it works flawlessly. Thank you so much for your work! |
…heet. SM2235 actually uses the same model identifier as SM2335.
…e/directory structure intact, lint cleanup.
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.
Minor change, but otherwise good to go
Remove unnecessary coroutine declaration Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Remove unnecessary coroutine declaration Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
What does this implement/fix?
This implements a base LED driver for Sunmoon Microelectronics 10 bit LED driver base support the SM2235 and SM2335 LED drivers. The SM2335 LED driver can be found in the SwitchBot Color Bulb.
Note: The existing SM2135 driver is 8 bit and substantially different, so must remain a separate component not using this new base.
Types of changes
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#2514
Test Environment
Example entry for
config.yaml
:SM2335:
SM2235:
Checklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: