项目作者: mishailovic

项目描述 :
Simple python lib to interact with Xiaomi lamps [WIP]
高级语言: Python
项目地址: git://github.com/mishailovic/lampa.py.git
创建时间: 2021-05-11T16:57:32Z
项目社区:https://github.com/mishailovic/lampa.py

开源协议:MIT License

下载


lampa.py

Simple python lib to interact with Xiaomi lamps [WIP]

Before installing:

To configure all your lamps, you need to download Yeelight app from App Store or Google Play. When you will be asked about region, choose Frankfurt.


Region

region

(This is a region with a minimum latency, and unfortunately I also did not understand how to find out which region the user is in.)

Add all your lamps, and most importantly, give them recognizable short names without special characters, so it will be easier for you to control the lamps in the future.


Lamp naming example

region

Well done! You are ready to install the library and you can uninstall yeelight if you don’t need it.

Installation:

  1. git clone https://github.com/mishailovic/lampa.py
  2. cd lampa.py
  3. pip3 install -r requirements.txt

Logging in and getting information ablout lamps:

  1. python3 login.py

This script will automatically receive all your lamp’s credentials, just follow the instructions in the terminal.

Examle usage:

  1. >>> import lampa
  2. >>> lampa.toggle("bedside", "on") # ("bedside" is a name of my lamp which i configured in yeelight app.)

lamp turns on, hooray!

Docs:

Comming soon!