Metadata-Version: 2.4
Name: pyvlx
Version: 0.2.33
Summary: PyVLX is a wrapper for the Velux KLF 200 API. PyVLX enables you to run scenes and or open and close velux windows.
Author-email: Julius Mittenzwei <julius@mittenzwei.com>
License: LGPL-3.0-or-later
Project-URL: Homepage, https://github.com/Julius2342/pyvlx
Project-URL: Source, https://github.com/Julius2342/pyvlx
Project-URL: Bug Tracker, https://github.com/Julius2342/pyvlx/issues
Keywords: velux,KLF,200,home,automation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Developers
Classifier: Topic :: System :: Hardware :: Hardware Drivers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyYAML<7.0,>=6.0
Requires-Dist: zeroconf>=0.148
Provides-Extra: dev
Requires-Dist: flake8-isort==7.0.0; extra == "dev"
Requires-Dist: flake8-pyproject==1.2.4; extra == "dev"
Requires-Dist: flake8==7.3.0; extra == "dev"
Requires-Dist: isort==8.0.1; extra == "dev"
Requires-Dist: mypy==1.20.0; extra == "dev"
Requires-Dist: pydocstyle==6.3.0; extra == "dev"
Requires-Dist: pylint==4.0.5; extra == "dev"
Requires-Dist: pytest-cov==7.1.0; extra == "dev"
Requires-Dist: pytest==9.0.3; extra == "dev"
Requires-Dist: types-PyYAML==6.0.12.20260408; extra == "dev"
Provides-Extra: release
Requires-Dist: build==1.4.2; extra == "release"
Requires-Dist: twine==6.2.0; extra == "release"
Dynamic: license-file

PyVLX - controlling VELUX windows with Python
============================================

[![CI](https://github.com/Julius2342/pyvlx/actions/workflows/ci.yml/badge.svg)](https://github.com/Julius2342/pyvlx/actions/workflows/ci.yml)

PyVLX uses the Velux KLF 200 interface to control io-Homecontrol devices, e.g. Velux Windows.

Please note: The KLF 200 is discontinued by Velux and even though the KLF 150 is marketed as its replacement device, it does **not** work with this library (it is missing the local API) unfortunately. 

Installation
------------

PyVLX can be installed via:

```bash
pip3 install pyvlx
```

Development
-----------

Contributor setup and dependency generation are documented in [DEVELOPMENT.md](DEVELOPMENT.md).

Home Assistant Plugin
---------------------

PyVLX is used within [Home Assistant](https://www.home-assistant.io/integrations/velux/). The HA Velux integration can be added in the HA UI.

*Please note that to connect you need to use the WiFi password, not the web login.*

For debugging frames enable debug logging for the Velux integration in the HA UI.

Basic Operations
----------------

```python
"""Just a demo of the PyVLX module."""
import asyncio
import logging

from pyvlx import Position, PyVLX


async def main() -> None:
    """Demonstrate functionality of PyVLX."""
    pyvlx = PyVLX('pyvlx.yaml')
    # Alternative:
    # pyvlx = PyVLX(host="192.168.2.127", password="velux123")

    # Runing scenes:
    await pyvlx.load_scenes()
    await pyvlx.scenes["All Windows Closed"].run()

    # Changing position of windows:
    await pyvlx.load_nodes()
    await pyvlx.nodes['Bath'].open()
    await pyvlx.nodes['Bath'].close()
    await pyvlx.nodes['Bath'].set_position(Position(position_percent=45))

    # Changing of on-off switches:
    # await pyvlx.nodes['CoffeeMaker'].set_on()
    # await pyvlx.nodes['CoffeeMaker'].set_off()

    # You can easily rename nodes:
    # await pyvlx.nodes["Window 10"].rename("Window 11")

    await pyvlx.disconnect()

if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)
    asyncio.run(main())
```
