Open GoogleCodeExporter opened 9 years ago
delayed for major release - need new function mapping or REST handler refactor.
Original comment by tro...@trouch.com
on 31 Jan 2014 at 2:02
If anyone really needs portWrite() on digital devices, here is a small
workaround that I use. Put the following code snippet into a custom server
script:
#----------------------
import webiopi
@webiopi.macro
def mPortWrite(digitalDeviceName, value):
digitalDevice = webiopi.deviceInstance(digitalDeviceName)
if digitalDevice != None:
return digitalDevice.portWrite(int(value))
#----------------------
It defines a macro that calls portWrite() for a digital device. The first
parameter is the name of the digital device, the second one is the interger
value to wite. This macro works only for digital devices, using names of other
ones will cause an error.
REST path would be (using your example above):
..../macros/mPortWrite/mcp,129
Don't forget to include the script into your config file with the correct path
to it.
Andreas
Original comment by andreas....@googlemail.com
on 30 Apr 2014 at 12:54
Original issue reported on code.google.com by
tro...@trouch.com
on 12 Jan 2014 at 12:21