if content["command"] == "setthermostatfanmode":
            print "set radio thermostat fan mode: " + internalid
        if content["command"] == "setthermostathold":
            print "set radio thermostat hold: " + internalid


# specify our message handler method
client.addHandler(messageHandler)

ipAddress = agoclient.getConfigOption("radiothermostat", "ipaddress",
                                      "0.0.0.0")
tempUnit = agoclient.getConfigOption("system", "units", "SI")
#print "IP: ", ipAddress
#print "UNIT: ", tempUnit
t = TStat(ipAddress)
t.setCacheExpiry(15)

client.addDevice(ipAddress, "thermostat")

#TODO implement thread here for polling
# in the background or need to handle some other communication. If you don't need one or if you want to keep things simple at the moment just skip this section.


class readThermostat(threading.Thread):
    #def cToF(tempC):
    #retval = float((float(tempC) * (9.0/5/0)) + 32)
    #return retval
    #def fToC(tempF):
    #retval = float((float(tempF) - 32) / (9.0/5.0))
    #return retval
    def __init__(self, ):
    		if content["command"] == "setthermostatfanmode":
			print "set radio thermostat fan mode: " + internalid
		if content["command"] == "setthermostathold":
			print "set radio thermostat hold: " + internalid


	
# specify our message handler method
client.addHandler(messageHandler)

ipAddress =  agoclient.getConfigOption("radiothermostat", "ipaddress", "0.0.0.0")
tempUnit = agoclient.getConfigOption("system", "units", "SI")
#print "IP: ", ipAddress
#print "UNIT: ", tempUnit
t = TStat(ipAddress)
t.setCacheExpiry(15)

client.addDevice(ipAddress, "thermostat")

#TODO implement thread here for polling
# in the background or need to handle some other communication. If you don't need one or if you want to keep things simple at the moment just skip this section.

class readThermostat(threading.Thread):
    #def cToF(tempC):
        #retval = float((float(tempC) * (9.0/5/0)) + 32)
        #return retval
    #def fToC(tempF):
        #retval = float((float(tempF) - 32) / (9.0/5.0))
        #return retval	
    def __init__(self,):
        threading.Thread.__init__(self)