Metadata-Version: 2.1
Name: pypck
Version: 0.7.5
Summary: LCN-PCK library
Home-page: https://github.com/alengwenus/pypck
Author: Andre Lengwenus
Author-email: alengwenus@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Eclipse Public License 1.0 (EPL-1.0)
Classifier: Operating System :: OS Independent
Classifier: Topic :: Home Automation
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# pypck

Open source LCN-PCK library written in Python

## Overview

**pypck** is an open source library written in Python which allows the connection to the [LCN (local control network) system](https://www.lcn.eu). It uses the vendor protocol LCN-PCK.
To get started an unused license of the coupling software LCN-PCHK and a hardware coupler is necessary.

**pypck** is used by the LCN integration of the [Home Assistant](https://home-assistant.io/) project.

## Example

```python
"""Example for switching an output port of moudle 10 on and off."""
import asyncio

from pypck.connection import PchkConnectionManager
from pypck.lcn_addr import LcnAddr

async def main():
    """Connect to PCK host, get module object and switch output port on and off."""
    async with PchkConnectionManager(
        "192.168.2.41",
        4114,
        username="lcn",
        password="lcn",
        settings={"SK_NUM_TRIES": 0},
    ) as pck_client:
        module10 = pck_client.get_address_conn(LcnAddr(0, 10, False))

        module10.dim_output(0, 100, 0)
        await asyncio.sleep(1)
        module10.dim_output(0, 0, 0)
        await asyncio.sleep(1)

asyncio.run(main())
```


