-
-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Move hardcoded parameter max_properties
#981
Conversation
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.
I'd personally rather like to see this as a class variable like the mapping itself, considering there should be no reason to change the value on the fly for subsequent requests on the same instance.
Yes. This is a temporary workaround. I used to use this method to determine whether the device is miot or miio. Both of them has miot-spec, but only miot devices works with it in LAN. I have thought a return code -9999 indicates that they are not miot, but recently found that some devices limit max_properties to a lower value and also returns -9999 when exceeded. |
Co-authored-by: Teemu R. <tpr@iki.fi>
1. Fix `MIoT` capitalization according to https://iot.mi.com/new/doc/design/spec/overall 2. Update `Home Assistant support` according to rytilahti#982 (comment)
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.
Great, thanks for the PR! 👍
* Move hardcoded parameter `max_properties` * Update miio/miot_device.py Co-authored-by: Teemu R. <tpr@iki.fi> * Update README.rst 1. Fix `MIoT` capitalization according to https://iot.mi.com/new/doc/design/spec/overall 2. Update `Home Assistant support` according to rytilahti#982 (comment) Co-authored-by: Teemu R. <tpr@iki.fi>
Not all devices limit max_properties to 15. We could make this parameter customizable.