Metadata-Version: 2.1
Name: sinricpro
Version: 2.2.2
Summary: A python package for your sinric-pro alexa skill
Home-page: https://github.com/sinricpro/python-sdk
Author: Dhanush
Author-email: dhanushdazz@gmail.com
License: UNKNOWN
Keywords: alexa,alexa-skill,sinric,sinric-alexa-skill,alexa-home-automation,sinric-pro,sinric-pro-alexa-skill
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Dist: loguru
Requires-Dist: websockets

SINRIC  PRO
===============

This is a python library for alexa home automation skill
 SINRIC PRO  https://sinric.pro/


Python-2.7 Not Supported
========================


Functions:
----------
* Automate your home using alexa with sinricpro

Installation :
--------------

Python3
-------

::

    python3 -m pip install sinricpro --user


Pro Switch Demo:
~~~~~~~~~~~~~~~~~

::

    from sinric import SinricPro
    from sinric import SinricProUdp
    from credentials import appKey, deviceId, secretKey
    from time import sleep

    def Events():
        while True:
            # Select as per your requirements
            # REMOVE THE COMMENTS TO USE
            # client.event_handler.raiseEvent(deviceId1, 'setPowerState',data={'state': 'On'})
            sleep(2) #Sleep for 2 seconds

    def onPowerState(did, state):
        # Alexa, turn ON/OFF Device
        print(did, state)
        return True, state


    eventsCallbacks={
        "Events": Events
    }

    callbacks = {
    'powerState': onPowerState
    }

    if __name__ == '__main__':
        client = SinricPro(appKey, deviceId, callbacks,event_callbacks=eventsCallbacks, enable_trace=False,secretKey=secretKey)
        udp_client = SinricProUdp(callbacks,deviceId,enable_trace=False)  # Set it to True to start logging request Offline Request/Response
        client.handle_all(udp_client)


