]>
vault307.fbx.one Git - garage_door_sensor.git/blob - garageCheck.py
2 import RPi
.GPIO
as GPIO
4 from bs4
import BeautifulSoup
11 GPIO
.setmode(GPIO
.BOARD
)
12 GPIO
.setup(37,GPIO
.OUT
)
13 GPIO
.setup(36,GPIO
.OUT
)
15 #garage=requests.get('http://garage.local')
19 garage
=requests
.get('http://garage.local')
20 soup
=BeautifulSoup((garage
.text
),features
='html.parser')
25 dstate
=soup
.find(id='dstate')
26 lstate
=soup
.find(id='lstate')
28 if dstate
.text
=='CLOSED':
30 if dstate
.text
=='OPEN':
32 if lstate
.text
=='OFF':
36 except AttributeError: