Skip to main content

Python client for dobaos service.

Project description

dobaos.py

Installation

pip install dobaos

Usage

# simple example, may be wrong

import time
import dobaos

doba = dobaos.Dobaos()

# description of datapoints
# all
print(doba.get_description(None))
# single
print(doba.get_description(1))
# multiple
print(doba.get_description([1, 2, 3]))

# same for datapoint values: all, single, multiple
print(doba.get_value(None))
print(doba.get_value(1))
print(doba.get_value([1, 2, 3]))

# send read request to bus. datapoints should have "UPDATE" flag
doba.read_value(1)
doba.read_value([1, 2, 3])

# set and send value to bus
doba.set_value({ "id": 1, "value": True })
# multiple values
doba.set_value([{ "id": 1, "value": True }, { "id": 2, "value": False}])
# without sending to bus
doba.put_value([{ "id": 1, "value": True }, { "id": 2, "value": False}])

# get BAOS information
print(doba.get_server_items())

# get programming mode info
print(doba.get_progmode())

# set KNX programming mode
doba.set_progmode(1)

# get daemon version
print(doba.get_version())

# send reset request
doba.reset()

# now process incoming messages
def process_baos_value(payload):
    did = payload['id']
    value = payload['value']
    raw = payload['raw']
    print(did, value, raw)

def process_server_item(payload):
    sid = payload['id']
    value = payload['value']
    print(sid, value)

while True:
    time.sleep(0.01)
    dpoints = doba.get_dpcast()
    for d in dpoints:
        process_baos_value(d)
    sitems = doba.get_sicast()
    for i in sitems:
        process_server_item(i)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dobaos-0.0.6.linux-x86_64.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file dobaos-0.0.6.linux-x86_64.tar.gz.

File metadata

  • Download URL: dobaos-0.0.6.linux-x86_64.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.3

File hashes

Hashes for dobaos-0.0.6.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 6d5bad1a17de63f0b0f1511d42319e49bbe2394ba64a1f1d58ceeff5284f4a0d
MD5 0073a2ee84ceb3b66a6da6188276249f
BLAKE2b-256 554203632300824684b40e9d291186a71b332f4e66d2de7fce90c6a2dee9f9b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page