Skip to content
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

retry on error code -30001 and -9999 #358

Merged
merged 1 commit into from
Oct 10, 2022
Merged

Conversation

0x5e
Copy link
Contributor

@0x5e 0x5e commented Oct 10, 2022

Fixes #355
Accroding to https://github.com/rytilahti/python-miio/blob/aa2718853455c40b5b8c2a1883019d8cb7a683b4/miio/miioprotocol.py#L272 and rytilahti/python-miio#1363
Some error code is recoverable.

Reproduced and fixed on mesh device 090615.switch.mesw2 with gateway xiaomi.wifispeaker.lx06, using:

miot send $GATEWAY_IP --token $GATEWAY_TOKEN --debug set_properties "[{\"did\":\"$DEVICE_ID\",\"value\":false,\"siid\":2,\"piid\":1}]" \
&& miot send $GATEWAY_IP --token $GATEWAY_TOKEN --debug set_properties "[{\"did\":\"$DEVICE_ID\",\"value\":false,\"siid\":2,\"piid\":1}]" \
&& miot send $GATEWAY_IP --token $GATEWAY_TOKEN --debug set_properties "[{\"did\":\"$DEVICE_ID\",\"value\":false,\"siid\":2,\"piid\":1}]" \
&& miot send $GATEWAY_IP --token $GATEWAY_TOKEN --debug set_properties "[{\"did\":\"$DEVICE_ID\",\"value\":false,\"siid\":2,\"piid\":1}]"

Default retries 1 is enough for processing error code -9999 in my test.

@merdok merdok merged commit 38f9ca7 into merdok:main Oct 10, 2022
@merdok
Copy link
Owner

merdok commented Oct 10, 2022

Thanks! That looks good! I think that i will also increase the retries to two for the miot CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

miot CLI works at most time, but sometime failed with ERROR user ack timeout.
2 participants