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.
recently,, i've updated HA to 2022.4 version; with the upgrade, the HomeAssistant-Tapo-P100-Control integration stopped working, so i updated everything (the integration, the PyP100 library) in order to get it working again
i've managed to get the plugs recognized at start (the setup_platform method goes ok with my 4 switches), but, when HA invokes the update method of each one, on the P100Plug class instances, it raises an exception on the handshake; i confirmed this error with this simple test code:
the error is raised on the second handshake; the PyP100, on the handshake method, tries to recover the result;
encryptedKey = r.json()["result"]["key"]
but the result subindex does not exists; the response is
{'error_code': 9999}
i've managed to get it working modifying the update method, adding a try-catch on both methods (handshake and login). It seems that the second handshake-login invocation raises an error for some reason (i don't know if its a problem of timing, or something related with a new firmware)
anyway, it seems that those invocations are not needed for the tapo p100 in order to work (i've tested it and the switches works like a charm, even throwing both exceptions)