An open API service indexing awesome lists of open source software.

https://github.com/wzpan/python2-miio

Python2 library for interfacing with Xiaomi miio components
https://github.com/wzpan/python2-miio

Last synced: 9 months ago
JSON representation

Python2 library for interfacing with Xiaomi miio components

Awesome Lists containing this project

README

          

# MusicBoxApi

[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE.txt)
[![platform](https://img.shields.io/badge/python-2.7-green.svg)]()

Python2 library & console tool for miio.

## Install

``` sh
pip install python2-miio
```

## Usage

* detect miio components:

``` sh
miio2 discover
```

* write your code to send messages to your miio components.

``` py
import miio

host = '192.168.1.103' # host
token = 'xxxxxxx' # token

fan = miio.device(host, token)
fan.send('set_power', ['on']) # start a smart mi fan
```