This commit is contained in:
brbjr1
2017-12-04 18:34:59 -06:00
parent d600904b83
commit cd4e553b01

View File

@@ -101,15 +101,14 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin,
@octoprint.plugin.BlueprintPlugin.route("/getOutputStatus", methods=["GET"])
def getOutputStatus(self):
getOutputStatusresult = ''
for rpi_output in self.rpi_outputs:
pin = self.toInt(rpi_output['gpioPin'])
if rpi_output['outputType']=='regular':
val = GPIO.input(pin) if not rpi_output['activeLow'] else (not GPIO.input(pin))
if not getOutputStatusresult:
if getOutputStatusresult:
getOutputStatusresult = getOutputStatusresult + ', '
getOutputStatusresult = getOutputStatusresult + '"' + str(pin) + '":' + str(val)
return '{' + getOutputStatusresult + '}'
return flask.jsonify('{' + getOutputStatusresult + '}')
@octoprint.plugin.BlueprintPlugin.route("/getTest", methods=["GET"])