Beispiel #1
0
 def getModelVendor(self, address):
     modeladdress = address.replace('/sys', '/tstat/model')
     deviceModelUrl = urllib2.urlopen(modeladdress, timeout=5)
     if deviceModelUrl.getcode() == 200:
         deviceModel = parseJSONresponse(deviceModelUrl.read(), "model")
     else:
         deviceModel = 'unknown'
     deviceVendor = "RadioThermostat"
     deviceModelUrl.close()
     return {'model': deviceModel, 'vendor': deviceVendor}
Beispiel #2
0
 def getMACAddress(self, address):
     deviceuuidUrl = urllib2.urlopen(address, timeout=5)
     mac_address = parseJSONresponse(deviceuuidUrl.read().decode("utf-8"),
                                     "uuid")
     return mac_address