darrylb123 / usbrelay

Control usb relay - based on hidapi
GNU General Public License v2.0
316 stars 98 forks source link

Python get relay status? #98

Closed durian closed 1 year ago

durian commented 1 year ago

Is it possible to get the status of a single relay from the Python module? The board_control() function only seems to be able to switch a relay on or off, and I did not find another function in the Python code.

darrylb123 commented 1 year ago

The function board_details() returns an array of the modules and the state of each module. The state is returned as an integer of all relays. Have a look at the tests/usbrelay_tests.py for an example

Darryl

On Sun, 8 Jan 2023, 9:18 pm Peter Berck, @.***> wrote:

Is it possible to get the status of a single relay from the Python module? The board_control() function only seems to be able to switch a relay on or off, and I did not find another function in the Python code.

— Reply to this email directly, view it on GitHub https://github.com/darrylb123/usbrelay/issues/98, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTSUVKBF4732FVBEL5SGVDWRKO77ANCNFSM6AAAAAATUQOTCA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

durian commented 1 year ago

Yes, thanks, that will work!