data_read #1

Merged
accidentallycompetent merged 7 commits from data_read into main 2023-11-14 22:53:03 +00:00
3 changed files with 15 additions and 3 deletions
Showing only changes of commit b1ba481089 - Show all commits

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: try:
async with self.fanClient as client: async with self.fanClient as client:
result = await client.read_gatt_char(CHARACTERISTIC) 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: except Exception:
return 0 return 0
@ -75,7 +75,6 @@ class Headwind:
try: try:
async with self.fanClient as client: async with self.fanClient as client:
await client.write_gatt_char(CHARACTERISTIC, value) await client.write_gatt_char(CHARACTERISTIC, value)
# print("flag")
return True return True
except Exception as e: except Exception as e:
return False return False

View File

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