Reorganize yeelight specs file#1166
Reorganize yeelight specs file#1166rytilahti merged 6 commits intorytilahti:masterfrom Kirmas:yeelight_spec
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1166 +/- ##
==========================================
+ Coverage 78.28% 78.32% +0.03%
==========================================
Files 84 84
Lines 9520 9531 +11
Branches 776 778 +2
==========================================
+ Hits 7453 7465 +12
- Misses 1880 1881 +1
+ Partials 187 185 -2
Continue to review full report at Codecov.
|
|
@rytilahti Could you please review this? I don't planning this PR and now it holding me. |
| @attr.s(auto_attribs=True) | ||
| class YeelightModelInfo: | ||
| model: str | ||
| class YeelightLamplInfo: |
There was a problem hiding this comment.
| class YeelightLamplInfo: | |
| class YeelightLampInfo: |
| value["background_light"], | ||
| value["supports_color"], | ||
| ) | ||
| if "main" not in value: |
There was a problem hiding this comment.
Considering there is no way not to have a main light, would it make sense to avoid the separate indent level and list main light features on the top-level?
There was a problem hiding this comment.
I did this so that the main and background light have the same structure. In my opinion, this is a more flexible option.
There was a problem hiding this comment.
I'm fine with that, even when I think the main interface should directly control the main light. I suppose I was just wondering if there could be a case where there is a main light & several sublights on a device.
I added a couple of comments, but you know that you can always rebase another branch (and PR) on top of an existing one to avoid hold ups? :-) |
Honestly don't know. Thank you for something new. |
You are welcome, if you want to know more, take a look at https://git-scm.com/book/en/v2/Git-Branching-Rebasing - it gets a bit complicated when working with several branches, but with two branches (+ master) you can do something like this: One thing to notice: as rebasing will rewrite the commit history (by adding those commits in-between), using it makes it necessary to do a force push when pushing changes to a remote which loses the existing history of that branch (and e.g., github comments). |
Today I understood that background light can have different params. (now its not true but who know). And theoretically new struct can do "background lamp" code simpler in the future.