purple4reina / gosundpy

Python API for controling Gosund smart devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gosundpy

PyPI version PyPI - Downloads

Control your Gosund smart devices via python code.

Install

pip install gosundpy

Prerequisites

In order to control your devices, you must register your devices using the Tuya Smart app (ios/android) and create a new Cloud Project in the Tuya IoT Platform.

Usage

import time

from gosundpy import Gosund

gosund = Gosund('username', 'password', 'access_id', 'access_key')

commands = ['turn_off', 'turn_on', 'turn_off', 'switch', 'switch', 'turn_off']

switch = gosund.get_device('12345')
for cmd in commands:
    getattr(switch, cmd)()
    time.sleep(1)

lightbulb = gosund.get_device('67890')
for cmd in commands:
    getattr(lightbulb, cmd)()
    time.sleep(1)

About

Python API for controling Gosund smart devices

License:MIT License


Languages

Language:Python 96.6%Language:Shell 3.4%