starting work on docker image

This commit is contained in:
Tomasz Frątczak 2023-11-14 19:05:44 +01:00
parent 1c8980f3a5
commit b1ba481089
3 changed files with 15 additions and 3 deletions

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM --platform=$BUILDPLATFORM python:3.10-alpine AS builder
WORKDIR /app
COPY requirements.txt /app
RUN pip3 install -r requirements.txt
COPY . /app
CMD ["python", "main.py"]

View File

@ -33,7 +33,7 @@ class Headwind:
try:
async with self.fanClient as client:
result = await client.read_gatt_char(CHARACTERISTIC)
return result[3] # Return state code
return result[3] # Return state code, needs to figure out what each code means
except Exception:
return 0
@ -75,7 +75,6 @@ class Headwind:
try:
async with self.fanClient as client:
await client.write_gatt_char(CHARACTERISTIC, value)
# print("flag")
return True
except Exception as e:
return False

View File

@ -1,2 +1,5 @@
#!/usr/bin/env python3
from bluewind import bluewind
from bluewind import app
if __name__ == '__main__':
app.run(debug=False)