-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
25 lines (20 loc) · 655 Bytes
/
app.py
File metadata and controls
25 lines (20 loc) · 655 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from __future__ import division
from webthing import (SingleThing, WebThingServer)
import logging
import weatherstationbme680
def run_server():
weatherstation = weatherstationbme680.WeatherstationBME680()
server = WebThingServer(SingleThing(weatherstation), port=8888)
try:
logging.info('starting the server')
server.start()
except KeyboardInterrupt:
logging.info('stopping the server')
server.stop()
logging.info('done')
if __name__ == '__main__':
logging.basicConfig(
level=10,
format="%(asctime)s %(filename)s:%(lineno)s %(levelname)s %(message)s"
)
run_server()