GithubHelp home page GithubHelp logo

yuhala / plugp100 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from petretiandrea/plugp100

0.0 0.0 0.0 268 KB

Work in progress implementation of tapo protocol in python.

License: GNU General Public License v3.0

Python 100.00%

plugp100's Introduction

Plug P100

This is a fork of original work of @K4CZP3R

The purpose of this fork is to provide the library as PyPi package.

How to install

pip install plugp100

Code example

import asyncio

from plugp100 import TapoApiClient, TapoApiClientConfig
from plugp100.api.light_effect import LightEffectPreset


async def main():
    # create generic tapo api
    config = TapoApiClientConfig("<ip>", "<email>", "<passwd>")
    sw = TapoApiClient.from_config(config)
    await sw.login()
    await sw.off()
    state = await sw.get_state()
    print(state.firmware_version)
    print(state.is_hardware_v2)

    # color temperature and brightness
    await sw.set_color_temperature(4000)
    await sw.set_brightness(100)

    # light effect example
    await sw.set_light_effect(LightEffectPreset.rainbow().effect)
    state = await sw.get_state()
    print(state.get_unmapped_state())
    print(state.get_unmapped_state())
    print(state.get_energy_unmapped_state())
    print(state.get_semantic_firmware_version())


if __name__ == "__main__":
    loop = asyncio.new_event_loop()
    loop.run_until_complete(main())
    loop.run_until_complete(asyncio.sleep(0.1))
    loop.close()

plugp100's People

Contributors

petretiandrea avatar renovate[bot] avatar dependabot[bot] avatar k4czp3r avatar domensoklic avatar mochipon avatar sbte avatar larueli avatar jfox-sk avatar srd424 avatar piio avatar

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.