fix host flag and simplify the headwind constructor
This commit is contained in:
parent
71ab300339
commit
28a8c01a5a
|
@ -1,12 +1,11 @@
|
||||||
# Initialise flask
|
# Initialise flask
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.config['SERVER_NAME'] = '0.0.0.0:5000'
|
|
||||||
app.config.from_prefixed_env()
|
app.config.from_prefixed_env()
|
||||||
|
|
||||||
# Initialise the bluetooth stack
|
# Initialise the bluetooth stack
|
||||||
from bluewind import headwind
|
from bluewind import headwind
|
||||||
fan = headwind.Headwind(app, app.config["ADDRESS"])
|
fan = headwind.Headwind(app.config["ADDRESS"])
|
||||||
|
|
||||||
# Load the views
|
# Load the views
|
||||||
from bluewind import views
|
from bluewind import views
|
|
@ -16,9 +16,7 @@ CHARACTERISTIC = "a026e038-0a7d-4ab3-97fa-f1500f9feb8b"
|
||||||
|
|
||||||
class Headwind:
|
class Headwind:
|
||||||
fanClient = None
|
fanClient = None
|
||||||
flaskApp = None
|
def __init__(self, address):
|
||||||
def __init__(self, flaskApp, address):
|
|
||||||
self.flaskApp = flaskApp
|
|
||||||
self.fanClient = BleakClient(address)
|
self.fanClient = BleakClient(address)
|
||||||
|
|
||||||
async def readSpeed(self):
|
async def readSpeed(self):
|
||||||
|
|
Loading…
Reference in New Issue