ibm-watson-iot / iot-python

Python Package and samples for connecting to Maximo IoT and IBM Watson IoT Platform
http://ibm-watson-iot.github.io/iot-python/
Eclipse Public License 1.0
187 stars 161 forks source link

global name 'result' is not defined error while using publisher #15

Closed raghunayak closed 8 years ago

raghunayak commented 8 years ago

I am trying to use application publishCommand function & getting "global name 'result' is not defined error".

Below is the sample code

def start(device_config_file):
    try:
        try:
            # Read from the configuration file
            device_options = ibmiotf.application.ParseConfigFile(device_config_file)
            client = ibmiotf.application.Client(device_options)
        except Exception as e:
            print(str(e))
            sys.exit()
        client.deviceEventCallback = deviceEventCallback
        client.connect()

        mydata = {'switch-led': 'false'}
        while 1:
            client.publishCommand("RasberryPi", "b827ebe3db7a", "command", "json", mydata)
            time.sleep(1)
        client.disconnect()

    except Exception as e:
        print(str(e))
        sys.exit()
raghunayak commented 8 years ago

Closing the issue as pull request is merged & issue is fixed in master.