You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ideally all these LED operations should be done automatically by when_activated & when_deactivated callback functions associated with the relays. Unfortunately the gpiozero DigitalOutputDevice class doesn't have those attributes like DigitalInput does. But! We could fairly easily fix that oversight by making out own DigitalOutputDevice subclass that includes the EventsMixin though... I think it would be a simple as:
from gpiozero import DigitalInputDevice, DigitalOutputDevice
from gpiozero.mixins import EventsMixin
class EventfulDigitalOutputDevice(EventsMixin, DigitalOutputDevice):
pass
Have tried the above but the callback functions do not seem to get activated by the DigitalOutputDevice.on() calls used to switch the relay positions. Probably need to do a little bit more poking around to figure out what's going on
Ideally all these LED operations should be done automatically by
when_activated
&when_deactivated
callback functions associated with the relays. Unfortunately the gpiozeroDigitalOutputDevice
class doesn't have those attributes likeDigitalInput
does. But! We could fairly easily fix that oversight by making out ownDigitalOutputDevice
subclass that includes theEventsMixin
though... I think it would be a simple as:Multiple inheritance is powerful magic...
Originally posted by @AnthonyHorton in https://github.com/_render_node/MDE3OlB1bGxSZXF1ZXN0UmV2aWV3Mjk1OTgyODEx/pull_request_reviews/more_threads
The text was updated successfully, but these errors were encountered: