Home

Awesome

Contributors Forks Stargazers Issues MIT License

<!--[![LinkedIn][linkedin-shield]][linkedin-url]--> <!-- PROJECT LOGO --> <br /> <p align="center"> <h3 align="center">MiCloud</h3> <p align="center"> Library for connecting to xiaomi cloud. <br /> <br /> <a href="https://github.com/Squachen/micloud/issues">Report Bug</a> · <a href="https://github.com/Squachen/micloud/issues">Request Feature</a> </p> </p>

About The Project

Simple implementation for logging in to your Xiaomi cloud account and fetch device information.

<!-- USAGE EXAMPLES -->

Usage

How to get and use micloud.

Getting it

To download micloud, either fork this github repo or use Pypi via pip.

$ pip install micloud

Using it

You can use micloud in your project or directly from the terminal.

In terminal:

Usage: micloud [OPTIONS]

Options:
  -u, --username TEXT  Your Xiaomi username.
  -c, --country TEXT   Language code of the server to query. Default: "de"
  --pretty             Pretty print json output.
  --help               Show this message and exit.
<img src="https://raw.githubusercontent.com/Squachen/micloud/master/docs/cli_example1.png" width="500">

In code:

As of right now there's not much you can do. You can login and get device info from Xiaomi cloud:

from micloud import MiCloud

mc = MiCloud("USERNAME", "PASSWORD")
mc.login()
token = mc.get_token() # to get your cloud service token.
device_list = mc.get_devices() # get list of devices

To query a different server, use the country argument:

device_list = mc.get_devices(country="cn")

And to save the device list as json:

mc.get_devices(country="cn", save=True, file="devices.json")
<!-- LICENSE -->

License

Distributed under the MIT License. See LICENSE for more information.

<!-- CONTACT -->

Contact

Sammy Svensson - @S_Svensson - sammy@ssvensson.se

Project Link: https://github.com/squachen/micloud

<!-- MARKDOWN LINKS & IMAGES --> <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->