python interface to the dobiss developer api
Project description
pydobiss Module Repository
pydobiss
dobissapi is a python library that allows you to use dobiss's api.
Install
pip install pydobiss
Example
import asyncio
import aiohttp
import logging
from time import sleep
import dobissapi
#dobissapi.logger.setLevel(logging.DEBUG)
secret = 'secret'
host = 'my_host'
secure = False
dobiss = dobissapi.DobissAPI(secret, host, secure)
async def main():
if not await dobiss.auth_check():
print("Error authenticating dobiss")
return
print("authenticated dobiss")
asyncio.get_event_loop().create_task(dobiss.dobiss_monitor())
entities = await dobiss.discovery()
await dobiss.update_all()
# check if caching works
entities = await dobiss.discovery()
# list scenarios
scenarios = dobiss.get_devices_by_type(dobissapi.DobissScenario)
for e in scenarios:
print("{}: {}".format(e.object_id, e.json))
# see if there are any buddies
def test_covers(entities):
for e in entities:
if e.buddy:
print(f"buddies found: {e.name} --> buddy {e.buddy.name}")
test_covers(entities)
def get_entity(entities, name):
for e in entities:
if e.name == name:
return e
# test updating and changing entities
await get_entity(entities, "Mancave").update()
await get_entity(entities, "Mancave").toggle()
await asyncio.sleep(2)
await get_entity(entities, "Mancave").toggle()
# test callbacks
def my_callback():
print("callback happened")
get_entity(entities, "Mancave").register_callback(my_callback)
await asyncio.sleep(2)
await get_entity(entities, "Mancave").turn_on()
await asyncio.sleep(2)
await get_entity(entities, "Mancave").turn_off()
# check if new discovery works fine with old callback
await asyncio.sleep(60)
entities = await dobiss.discovery()
await asyncio.sleep(2)
await get_entity(entities, "Mancave").turn_on()
await asyncio.sleep(2)
await get_entity(entities, "Mancave").turn_off()
try:
loop = asyncio.get_event_loop()
loop.create_task(main())
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydobiss-0.1.56.tar.gz.
File metadata
- Download URL: pydobiss-0.1.56.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a384c044f71b4d19ddfc3611a302a9a2030cbdfb09deef0b4c83dcf7d1e9c97
|
|
| MD5 |
7c094940511be174e15d03c5375ac824
|
|
| BLAKE2b-256 |
8837eb43ae86d81bc57b4468f3576df0999011b617d8038e7158c1c0a5d04741
|
Provenance
The following attestation bundles were made for pydobiss-0.1.56.tar.gz:
Publisher:
pypi.yml on kesteraernoudt/pydobiss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydobiss-0.1.56.tar.gz -
Subject digest:
1a384c044f71b4d19ddfc3611a302a9a2030cbdfb09deef0b4c83dcf7d1e9c97 - Sigstore transparency entry: 634522434
- Sigstore integration time:
-
Permalink:
kesteraernoudt/pydobiss@a2d16aa808e3212643878732d798425ced4bc5f3 -
Branch / Tag:
refs/tags/v0.1.56 - Owner: https://github.com/kesteraernoudt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@a2d16aa808e3212643878732d798425ced4bc5f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pydobiss-0.1.56-py3-none-any.whl.
File metadata
- Download URL: pydobiss-0.1.56-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d77f1850236a379e21a355af2a899208805a485a72472ccc63f13be240ce4fee
|
|
| MD5 |
ba06dfe0d3db58fb0957e1f2fc4e5ab7
|
|
| BLAKE2b-256 |
c77a0c1c8d05aff237a0bcaa7ad24d7927549faaf3bad0009dacd6f1fead04ab
|
Provenance
The following attestation bundles were made for pydobiss-0.1.56-py3-none-any.whl:
Publisher:
pypi.yml on kesteraernoudt/pydobiss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydobiss-0.1.56-py3-none-any.whl -
Subject digest:
d77f1850236a379e21a355af2a899208805a485a72472ccc63f13be240ce4fee - Sigstore transparency entry: 634522436
- Sigstore integration time:
-
Permalink:
kesteraernoudt/pydobiss@a2d16aa808e3212643878732d798425ced4bc5f3 -
Branch / Tag:
refs/tags/v0.1.56 - Owner: https://github.com/kesteraernoudt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@a2d16aa808e3212643878732d798425ced4bc5f3 -
Trigger Event:
push
-
Statement type: