Repository navigation
Read and switch Kasa bulbs - #8
Merged
Merged
Conversation
Bulbs have no relay_state, so they always read as off, and the relay command does nothing on them. Switch replies now check err_code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kasa bulbs report on/off in
light_state.on_offand have norelay_state, so plugctl read a lit bulb as off, and the plug's relay command does not switch one.light_stateis treated as a bulb: state comes fromlight_state.on_off, and switching goes throughsmartlife.iot.smartbulb.lightingservice/transition_light_statewith no fade. Light strips (sysinfo haslength) usesmartlife.iot.lightStrip; no strip was available to test.err_codefor plugs too, so a command the device rejects is an error rather than a silent success.Tested: unit tests for parsing and commands;
plugctl stateon two KL125 bulbs agrees with python-kasa (read-only). On a KL125: on, cycle (5 s) and off switched it at once and each was read back; python-kasa confirmed it ended off. On an HS103 that was already on,onpassed the new err_code check.