rytilahti / python-miio

Python library & console tool for controlling Xiaomi smart appliances
https://python-miio.readthedocs.io
GNU General Public License v3.0
3.62k stars 547 forks source link

Question: Would this work on an embedded device using micropython? #1780

Open theRealSuperMario opened 1 year ago

theRealSuperMario commented 1 year ago

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 😀

rytilahti commented 1 year ago

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.

theRealSuperMario commented 1 year ago

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.

rytilahti commented 1 year ago

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:

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.