Exemple #1
0
 def execute(self, deviceData, mqttClient=None):
     print 'Run LineControl.......'
     d_Data = deviceData['DeviceData']
     temp_c = float(d_Data['Temperature_C'])
     msgPlainTxt = "Warning message from IOT platform: current temperature is over threshold:" + str(
         temp_c)
     #       Initial Line client
     client = LineClient(
         authToken=
         'DOFM6cNhM8VIuKmyOXK2.azad0AlpxQy6iJzh2pQLqG.By8oDIYL8bQ8KNscNnygUVN7HngF0vweWFwHG1lGyII='
     )
     friend = client.getContactFromName('Wester')
     friend.sendMessage(msgPlainTxt)
     return None