I had some issues with our implementation of the click detection on the smartswitch. While searching for a better solution I stumbled accross the arduino clickButton library which is already ported to the photon.
Unfortunately the clickButton library is only working with photon/arduino pins and is not supporting a MCP23017 port extender which is used by the smartswitch. To fix this issue I modified the library for the use of an MCP23017.
The sources are on github: https://github.com/Trekky12/clickButtonMCP.