rkoshak / sensorReporter

A python based service that receives sensor inputs and publishes them in various ways.
Apache License 2.0
105 stars 41 forks source link

implement lgpio-lib for RpiGpioActuator & GpioColorLED #127

Closed DanielDecker closed 7 months ago

DanielDecker commented 7 months ago

This PR changes the GPIO library for the RpiGpioActuator & GpioColorLED to lgpio.

changed RpiGpioActuator & GpioColorLED to use lgpio instead of RPi.GPIO +added type annotation for RpiGpioActuator, GpioColorLED, core.sensor and core.actuator to allow type checking (e. g. with mypy) GpioColorLED modified so it can be used as a single-channel dimmer

Difference to the RPi.GPIO implementation: after exiting sensor_reporter the GPIOs return to the state before sensor_reporter claimed them. In a later PR I'll remove the ColorHSV class from the i2c.pwm file and use the one in utils.

Tested with Debian 12 (bookworm, kernel 6.6) with mqtt, home and openHab connector. This PR is ready to merge.

rkoshak commented 7 months ago

Do you want to make the changes to dependencies.txt in this PR too?

DanielDecker commented 7 months ago

Do you want to make the changes to dependencies.txt in this PR too?

Yes, I just pushed a commit with this and the typo fix you mentioned. Since my development environment has a spell checker, it's much easier to spot and correct the typos. :-)

Thanks for the quick review, by the way! Everything regarding this PR is done, it's ready for merge.

rkoshak commented 7 months ago

Since my development environment has a spell checker, it's much easier to spot and correct the typos. :-)

I originally developed this using just vim and it shows.