Question: Would this work on an embedded device using micropython?
Hi,
I have been using python-miio happily on my rapsberry pi 400, but wanted to switch to a smaller device. Hence I wanted to ask if there are any plans / features yet to support smaller devices like ESP and raspberry pi pico.
Thanks 😀
Looks like this was asked earlier (https://github.com/rytilahti/python-miio/discussions/1102), but I couldn't find any information what exactly is not working with such systems or what type of changes would be required? If you have such a device, would you mind checking out what changes would be required to make that happen?
This library is not very complex, so adding some sort of compat layer would not probably be that hard. Maybe some dependencies could be an issue though? Alas, I don't have currently time to work on it even if I had test hardware which I don't.
I See. Yes sure, I will dig into it and see what it takes. It will be interesting how to test this though. But I am confident it can be done.
Am 23.05.2023 um 21:36 schrieb Teemu R. @.***>:
Looks like this was asked earlier (#1102 https://github.com/rytilahti/python-miio/discussions/1102), but I couldn't find any information what exactly is not working with such systems or what type of changes would be required? If you have such a device, would you mind checking out what changes would be required to make that happen?
This library is not very complex, so adding some sort of compat layer would not probably be that hard. Maybe some dependencies could be an issue though? Alas, I don't have currently time to work on it even if I had test hardware which I don't.
— Reply to this email directly, view it on GitHub https://github.com/rytilahti/python-miio/issues/1780#issuecomment-1560019737, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRXFWOYC5ANOLGPUJVKOYLXHUGS7ANCNFSM6AAAAAAYMKX46U. You are receiving this because you authored the thread.
The dependencies might be the hardest part, see https://github.com/rytilahti/python-miio/blob/e15252c39d144c1815fd196975712e09db55bb5e/pyproject.toml#L29-L43
However, most of those might be easily replaceable or converted to be optional. The following are the "hard dependencies" for basic functionalities:
- click (for the cli tool, if only library interface is needed, this could probably be made optional)
- cryptography (for AES, replaceable but requires effort)
- construct (protocol parsing, replaceable but requires writing manual parsing for the binary data)
- attrs (could be converted to use dataclasses or pydantic, for example)
- pydantic (used only for miot support, if not needed, this could be made optional)
- pyyaml (used only for miot support, could be made optional)
- defusedxml (could be replaced with python's internal xml parser)
The rest are useful libraries for specific funtionalities (like micloud to get the tokens and miot schemas from the cloud), zeroconf for discovery, tqdm (which could be removed, used only by the updater to display a progress bar) etc.