Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commandArray = {}
- t1 = os.time()
- s = uservariables_lastupdate['IVTData']
- -- returns a date time like 2013-07-11 17:23:12
- year = string.sub(s, 1, 4)
- month = string.sub(s, 6, 7)
- day = string.sub(s, 9, 10)
- hour = string.sub(s, 12, 13)
- minutes = string.sub(s, 15, 16)
- seconds = string.sub(s, 18, 19)
- t2 = os.time{year=year, month=month, day=day, hour=hour, min=minutes, sec=seconds}
- difference = (os.difftime (t1, t2))
- print("IVTData last updated: " .. s .. " (" .. difference .. " seconds)." )
- textDeviceIdx = 461
- commandArray[textDeviceIdx] = {['UpdateDevice'] = textDeviceIdx..'|0|'.. difference}
- if (difference > 300) then
- commandArray['SendNotification']='IVTData!#IVTData saknas sen mer än 5 minuter!'
- end
- return commandArray
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement