Giter Club home page Giter Club logo

python-expower's Introduction

python-expower

Python 3 API for Expower Smart Bulbs

Expower Smart Wifi B22 Rgb Dimmable 7W LED Bulb

Tested Bulbs

Bulb Link
Expower Smart Wifi B22 Rgb Dimmable 7W LED Bulb http://www.iexpower.com/en/h_product_1482156406183304

Getting Started

You must first find some values identifying your Smart Bulb

Follow this tutorial: https://github.com/tombulled/python-expower/blob/master/KEY_EXTRACTION.md

If that doesn't help, see: https://github.com/clach04/python-tuya/wiki

Example Usage

>>> import expower
>>> from pprint import pprint
>>> 
>>> # Bulb information
>>> DEVICE_ID = '<<DeviceId>>'
>>> HOST = '<<BulbIP>>'
>>> LOCAL_KEY = '<<LocalKey>>'
>>> 
>>> # Create a <Bulb> instance
>>> bulb = expower.Bulb(DEVICE_ID, HOST, LOCAL_KEY)
>>> 
>>> # Get the bulb state
>>> pprint(bulb.state())
{'brightness': 100,
 'colour': (0, 255, 0),
 'mode': 'scene_4',
 'on': True,
 'scene': (56, 85, 180),
 'scenes': {'colourful': {'brightness': 41,
                          'colours': [(105, 38, 38),
                                      (0, 255, 255),
                                      (38, 105, 38),
                                      (38, 98, 105),
                                      (51, 38, 105),
                                      (105, 38, 97)],
                          'saturation': 64,
                          'speed': 10},
            'exciting': {'brightness': 10,
                         'colour': (255, 0, 0),
                         'saturation': 0,
                         'speed': 30},
            'soft': {'brightness': 4,
                     'colour': (0, 255, 0),
                     'saturation': 80,
                     'speed': 90},
            'wonderful': {'brightness': 100,
                          'colours': [(255, 0, 0),
                                      (255, 230, 0),
                                      (9, 255, 0),
                                      (0, 247, 255),
                                      (255, 255, 255),
                                      (247, 0, 255)],
                          'saturation': 100,
                          'speed': 5}},
 'temperature': 100}
>>> 
>>> # Change colour
>>> _ = bulb.set_green()
>>> _ = bulb.set_colour(50, 45, 37) # RGB values
>>> 
>>> # Get funky
>>> _ = bulb.set_wonderful()
>>> _ = bulb.edit_wonderful(speed=100)
>>> 

python-expower's People

Contributors

tombulled avatar

Stargazers

 avatar  avatar

python-expower's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.