Skip to main content

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: VdcHost → Vdc → Vdsd → 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,
    Output, OutputFunction, OutputUsage,
    ColorGroup, DeviceLifecycleState,
)

async def main():
    host = VdcHost(name="My Gateway", state_path="state.yaml")

    vdc = Vdc(host=host, implementation_id="x-myapp-lights",
              name="My Lights", model="Light Controller")
    host.add_vdc(vdc)

    device = Device(vdc=vdc, dsuid=DsUid.from_gtin_serial("0000000000001", "001"))
    vdsd = Vdsd(device=device, primary_group=ColorGroup.YELLOW,
                name="Living Room Light", model="My Light v1")
    output = Output(vdsd=vdsd, function=OutputFunction.DIMMER,
                    output_usage=OutputUsage.ROOM)
    vdsd.set_output(output)

    async def apply_channels(out: Output, updates: dict) -> None:
        if 0 in updates:  # brightness = dsIndex 0
            print(f"Set brightness to {updates[0]:.1f}%")
    output.on_channel_applied = apply_channels

    await vdsd.set_lifecycle_state(DeviceLifecycleState.ACTIVE)
    device.add_vdsd(vdsd)
    vdc.add_device(device)
    await host.start()
    await asyncio.Event().wait()

asyncio.run(main())

See the Developer Guide for a full walkthrough and API reference.

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

License

GPLv3 — see LICENSE.

Metadata

Release files for pydsvdcapi 0.9.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydsvdcapi 0.9.2
File Size Uploaded Provenance Actions
pydsvdcapi-0.9.2.tar.gz 313.9 kB With provenance Details for pydsvdcapi-0.9.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydsvdcapi 0.9.2
File Interpreter ABI Platform Actions
pydsvdcapi-0.9.2-py3-none-any.whl Python 3 none any Details for pydsvdcapi-0.9.2-py3-none-any.whl

Total release size: 514.0 kB

Release files / pydsvdcapi-0.9.2.tar.gz

Download URL pydsvdcapi-0.9.2.tar.gz
Size 313.9 kB
Tags Source
SHA-256 checksum
How to use checksums
615942dd0a5028eb2950e22e63903d07c23f50f046dd44bd147fa0c9238d7609
BLAKE2b-256 checksum
How to use checksums
3f9c77bd5bee09571b12f3c5ab884e871d4e4a0b9d9fc8e8f2c7c1df4e9d0e86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / pydsvdcapi-0.9.2-py3-none-any.whl

Download URL pydsvdcapi-0.9.2-py3-none-any.whl
Size 200.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfbb927ef361307a92187dcec24c0d71c8f7439880e1364cd7fc7c7b16d308d2
BLAKE2b-256 checksum
How to use checksums
9b8695374a52b3b4d9292a59dcd5648c1c44e9447c6a943e73c67cca710d4834
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Security for pydsvdcapi 0.9.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pydsvdcapi-0.9.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page