View Single Post
kimmoli's Avatar
Posts: 562 | Thanked: 2,744 times | Joined on Dec 2013 @ Espoo, Finland
#104
Originally Posted by asys3 View Post
If I don't miss anything we do it the other way round: using a switch calls a script.
Yes, toggling the switch causes interrupt, which tells daemon to read switch states from gpio expander over i2c.
Daemon them compares read states to previous states, and executes a specified script of state which really changed.

Originally Posted by asys3 View Post
Is it possible to check the position of a switch?
...
Can we also read out the positions of all switches?
Not at the moment, but I can add e.g. dbus interface to check the current state? or write them to a file e.g. /tmp/dipswitchstate when ever they change.

To prevent the whole diptoh to die after single connection break, i think i will add timer to periodically check and re-init gpio expander if needed.
__________________
TOH ideas, concepts and creations since 2013 toholed tohuart toheink Heebo tohIRi i2ctool tohmm LeTOH FMTOH
 

The Following 2 Users Say Thank You to kimmoli For This Useful Post: