-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
Use device-native kelvins for tplink color temperature #85646
Use device-native kelvins for tplink color temperature #85646
Conversation
Hey there @TheGardenMonkey, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
I have no clue why the mypy is still failing:
The variable in question on 216 is typed to be optional:
which is what the upstream library also expects: https://github.com/python-kasa/python-kasa/blob/master/kasa/smartbulb.py#L483 edit: Potentially related to the use of implicit optionals (https://github.com/python-kasa/python-kasa/blob/0.5.0/kasa/smartbulb.py#L382) which was fixed in python-kasa/python-kasa#401 that has not yet been released. Any ideas for the simplest fix without preparing a new release? |
b4fa01b
to
d981f27
Compare
python-kasa 0.5.0 uses implicit optionals causing mypy to fail, this should get fixed when #88416 gets merged and this PR gets rebased. edit: looks like that fixes it, so after the bump PR gets merged I'll rebase this again on top of the dev. |
d981f27
to
e57a588
Compare
e57a588
to
192a543
Compare
I think this looks good. Need to find time to test it |
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.
Tested with
KL125(US)
by TP-Link
Firmware: 1.0.7 Build 210811 Rel.171439
Hardware: 2.0
👍
Thanks @rytilahti |
If there someone with hundreds of bulbs in production it might be worth changing out https://github.com/python-kasa/python-kasa/blob/6be2f387f04867b1af554cf25c674425f8d0e1d9/kasa/protocol.py#L99 |
Proposed change
This PR converts tplink's light platform to use device-native kelvins for color temperature handling which allows getting rid of mired<->kelvin conversions.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: