GithubHelp home page GithubHelp logo

python_tydom's Introduction

Python Tydom

Another simple python implementation to access Tydom gateway.

Based on:

Why using this implementation?

  • Very easy to use!!!
  • Fully asynchronous (asyncio async/await)
  • Manage tydom push request through callback
  • Optional keep alive through ping command
  • Automatic reconnection on keep alive failure
  • Easy to integrate into an home automation system (Home Assistant, Jeedom...)
  • No MQTT

Tydom Push request

Tydom gateway automatically sends a push request when an event occurs (alarm mode change). This means that an incoming PUT request is received on the websocket.

Requirements

  • Python >= 3.5
  • websockets

Limitations

  • Tested in local mode only (local ip connection)
  • Low level command implementation (no feature abstraction)

Sample Code

def  callback(uri, data):
    print(uri, data)

async def demo():
    # create tydom instance
    tydom = Tydom("00ABCDEF1234", "123456", host='192.168.0.20', request_handler=callback)

    # connect to tydom
    await tydom.connect(keep_alive_delay=None)
    
    # get data
    while True:
        data = await tydom.get_device_data(0)
        print(data)
        await asyncio.sleep(5)
        
asyncio.get_event_loop().run_until_complete(demo())

python_tydom's People

Contributors

sigmapic avatar

Stargazers

 avatar

Watchers

 avatar  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.