Skip to main content

Python library for the digitalSTROM vDC API

Project description

pydsvdcapi

CI PyPI Python License: GPLv3

Python library for the digitalSTROM virtual Device Connector (vDC) API.

What this library does

  • Implements the full vDC protobuf protocol over TCP
  • Manages the session lifecycle (hello/pong, announcement, reconnect)
  • Models all device classes: lights, blinds, sensors, buttons, heating, audio, and more
  • Provides a composable API: VdcHostVdcVdsd → components
  • Persists device state across restarts via a YAML property store
  • Automatically derives modelFeatures flags from configured components
  • Supports value converters for uplink/downlink data transformation

Installation

pip install pydsvdcapi

Requires Python 3.10+.

Quick start

import asyncio
from pydsvdcapi import (
    VdcHost, Vdc, Device, Vdsd,
    DsUid, DsUidNamespace,
    Output, OutputFunction, OutputMode, OutputUsage,
    ColorGroup,
)

async def main():
    host = VdcHost(dsuid=DsUid.new_uuid_based(), name="My VDC Host")

    vdc = Vdc(dsuid=DsUid.new_uuid_based(), name="My VDC")
    host.add_vdc(vdc)

    device = Device(dsuid=DsUid.new_gtin_based("0000000000001", 0))
    vdsd = Vdsd(dsuid=DsUid.new_uuid_based(), name="My Light")
    output = Output(
        function=OutputFunction.LIGHT,
        mode=OutputMode.SWITCH,
        usage=OutputUsage.ROOM,
        group=ColorGroup.YELLOW,
    )
    vdsd.set_output(output)
    device.add_vdsd(vdsd)
    vdc.add_device(device)

    await host.run()  # connects and blocks until stopped

asyncio.run(main())

See examples/getting_started.py for a minimal runnable example and examples/full_showcase.py for all 27 device classes.

Development

git clone https://github.com/KarlKiel/pyDSvDCAPI.git
cd pyDSvDCAPI
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
Command Purpose
python -m pytest Run tests
ruff check src/ tests/ Lint
ruff format src/ tests/ Format
mypy src/pydsvdcapi Type-check

See CONTRIBUTING.md for full guidance.

Documentation

API reference: pydsvdcapi.readthedocs.io

Domain documentation lives in docs/:

License

GPLv3 — see LICENSE.

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

pydsvdcapi-0.8.7.tar.gz (279.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydsvdcapi-0.8.7-py3-none-any.whl (183.3 kB view details)

Uploaded Python 3

File details

Details for the file pydsvdcapi-0.8.7.tar.gz.

File metadata

  • Download URL: pydsvdcapi-0.8.7.tar.gz
  • Upload date:
  • Size: 279.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydsvdcapi-0.8.7.tar.gz
Algorithm Hash digest
SHA256 2c14327b771db69d8afe405254e8eee9ecec02244d2689e915ef2397888df5b1
MD5 2be11d571f8eefee4a1251794bb9553e
BLAKE2b-256 f8c87092c0f25e136cfcb3a780e6214bb3ad38b50af4574ba165cadf3bc6c3d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydsvdcapi-0.8.7.tar.gz:

Publisher: publish.yml on KarlKiel/pydsvdcapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pydsvdcapi-0.8.7-py3-none-any.whl.

File metadata

  • Download URL: pydsvdcapi-0.8.7-py3-none-any.whl
  • Upload date:
  • Size: 183.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydsvdcapi-0.8.7-py3-none-any.whl
Algorithm Hash digest
SHA256 972d23fcb10ffc5a8e85fe04b96852d7ba8ed702da7397a34f89514c3e17b499
MD5 0be8d8cd870baab6f5c541ce9c10c484
BLAKE2b-256 3fd6ae7848d83df050cfc895d371e223d45b72366e326bd6e6d8940f19919914

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydsvdcapi-0.8.7-py3-none-any.whl:

Publisher: publish.yml on KarlKiel/pydsvdcapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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