autopilot
autopilot copied to clipboard
Stream method for hardware objects
From the discussion board (https://groups.google.com/g/autopilot-users/c/6jdWZv05bfI/m/1F438EqxCQAJ)
All hardware objects should be able to easily stream events.
The API that makes sense to me is something like this
from autopilot.hardware.gpio import Digital_In
pin = Digital_In(1)
pin.stream(pin.level, **stream_kwargs)
# or
pin.stream('level', **stream_kwargs)
In the interest of making this general, one strategy might be to make a decorator that wraps attributes of the object such that when they are updated a message is emitted to the configured streaming target.
punting this to 0.5.0 so we can work networking and method categories into a unified inheritance structure