]>
vault307.fbx.one Git - garage_door_sensor.git/blob - garageStatus.py
3 from bs4
import BeautifulSoup
5 ser
=serial
.Serial('/dev/ttyACM0',9600,timeout
=.5)
18 data
=str(ser
.readline())
28 with open('/var/www/html/index.html') as fp
:
29 soup
=BeautifulSoup((fp
),features
='html.parser')
30 dstate
=soup
.find(id='dstate')
31 lstate
=soup
.find(id='lstate')
38 dstate
=soup
.find(id='dstate')
40 with open('/var/www/html/index.html','w') as writer
:
41 writer
.write(str(soup
))
46 dstate
.string
='CLOSED'
47 with open('/var/www/html/index.html','w') as writer
:
48 writer
.write(str(soup
))