python interface to the dobiss developer api
Project description
pydobiss Module Repository
pydobiss
dobissapi is a lib that make you easier to use dobiss's api.
Install
pip install pydobiss
Example
import asyncio
from time import sleep
import dobissapi
secret = 'secret'
url = 'http://<ip>/api/local/'
ws_url = 'ws://<ip>/sockets/api'
dobiss = dobissapi.DobissAPI(secret, url, ws_url)
entities = dobiss.get_dobiss_devices()
dobiss.update_all(entities)
def get_entity(entities, name):
for e in entities:
if e.name == name:
return e
get_entity(entities, "Mancave").update()
get_entity(entities, "Mancave").toggle()
sleep(2)
get_entity(entities, "Mancave").toggle()
async def my_app():
await dobiss.dobiss_monitor(entities)
try:
loop = asyncio.get_event_loop()
loop.run_until_complete(my_app())
loop.run_forever()
except KeyboardInterrupt:
print("Exiting")
Author
Kester(kesteraernoudt@yahoo.com)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pydobiss-0.1.1.tar.gz
(5.2 kB
view hashes)