https://github.com/olekenneth/pyxcomfort
Python library for controlling Moeller Eaton Xcomfort lights.
https://github.com/olekenneth/pyxcomfort
hacktoberfest home-assistant home-automation lights smarthome xcomfort
Last synced: 10 months ago
JSON representation
Python library for controlling Moeller Eaton Xcomfort lights.
- Host: GitHub
- URL: https://github.com/olekenneth/pyxcomfort
- Owner: olekenneth
- License: gpl-3.0
- Created: 2018-04-20T18:24:06.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-12-02T09:53:43.000Z (over 1 year ago)
- Last Synced: 2024-12-02T10:36:48.925Z (over 1 year ago)
- Topics: hacktoberfest, home-assistant, home-automation, lights, smarthome, xcomfort
- Language: Python
- Homepage:
- Size: 365 KB
- Stars: 7
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyXcomfort
[](https://github.com/olekenneth/pyXcomfort/actions/workflows/tests.yml)
[](https://coveralls.io/github/olekenneth/pyXcomfort?branch=master)
[](https://snyk.io/test/github/olekenneth/pyXcomfort?targetFile=requirements.txt)
This is an **unofficial** Python library for controlling Moeller Eaton Xcomfort lights.
It requires the Xcomfort CRSZ-00/01 RS-232 programming interface.
This repository is not associated with Moeller Eaton, Home Assistant or other [integrations](/integrations).
If you are running [Home Assistant Supervisor](https://www.home-assistant.io/hassio/) you can use the [XComfort HA Addon](https://github.com/olekenneth/hassio-addons)
## How to use
```bash
git clone git@github.com:olekenneth/pyXcomfort.git xcomfort
```
### Callback when a specific light changes
```python
from xcomfort.xcomfort import Xcomfort
xcomfort = Xcomfort(devicePath='/dev/ttyUSB0')
xcomfort.lights = [{ serial: 2118491, name: 'Plafond' }, ... ]
def lightChangeCallback(light):
print(light.name + ' changed state to ' + str(light.state))
light = xcomfort.lights[0]
light.onChange(lightChangeCallback)
light.state = False # turn off the light
light.brightness = 25 # turn light on and set brightness to 25%
```
### Callback when one of the lights change
```python
xcomfort.onLight(lightChangeCallback)
```
## Contribute
Please contribute.
## License
GPLv3 see [LICENSE](LICENSE)