From: Steven Baltakatei Sandoval Date: Tue, 27 Oct 2020 19:00:05 +0000 (+0000) Subject: fix(exec/temp):Reduce socket calls for hostname X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02.git/commitdiff_plain/12b6bcb3d04144c9edddb3f76177fc9555918ed1?ds=inline fix(exec/temp):Reduce socket calls for hostname --- diff --git a/exec/temperature/DS18B20..temp_poll.py b/exec/temperature/DS18B20..temp_poll.py index f15926c..831e4aa 100755 --- a/exec/temperature/DS18B20..temp_poll.py +++ b/exec/temperature/DS18B20..temp_poll.py @@ -33,10 +33,12 @@ def read_temp(): #return temp_c, temp_f return temp_c_2dec + +myHostname = socket.gethostname() + while True: nowTimeIso8601 = strftime("%Y%m%dT%H%M%S%z") nowTimeUE = strftime("%s") nowTemp = read_temp() - myHostname = socket.gethostname() print(str(nowTimeIso8601) + ',' + str(nowTimeUE) + ',' + str(myHostname) + ',' + str(nowTemp)) time.sleep(1)