Delete 'office-status.py'
This commit is contained in:
parent
7355c332c4
commit
c7d5569916
|
@ -1,20 +0,0 @@
|
||||||
import serial
|
|
||||||
import time
|
|
||||||
ser = serial.Serial('/dev/ttyACM0', 9600)
|
|
||||||
|
|
||||||
html = '<meta name="viewport" content="width=device-width, initial-scale=1.0">\nThe office is currently '
|
|
||||||
|
|
||||||
data = ser.readline()
|
|
||||||
if data:
|
|
||||||
l = float(data.split("=")[1].strip())
|
|
||||||
if l > 1:
|
|
||||||
html += "open."
|
|
||||||
else:
|
|
||||||
html += "closed."
|
|
||||||
html += "<br>Updated At: " + time.strftime('%l:%M%p %Z on %b %d, %Y')
|
|
||||||
|
|
||||||
with open('/users/n3parikh/www/office-status.html', 'w') as f:
|
|
||||||
f.write(html)
|
|
||||||
else:
|
|
||||||
# TODO: print to log instead.
|
|
||||||
print("error")
|
|
Loading…
Reference in New Issue