Major overhaul
This commit is contained in:
parent
0facdf9ad5
commit
caa5c088cc
6
.env.template
Normal file
6
.env.template
Normal file
@ -0,0 +1,6 @@
|
||||
XMPP_RECEIVER=
|
||||
XMPP_SENDER=
|
||||
XMPP_SENDER_PASSWORD=
|
||||
SET_POINT=82.22
|
||||
MESSAGE="The water is too damn hot! :tea:"
|
||||
|
6
requirements.txt
Normal file
6
requirements.txt
Normal file
@ -0,0 +1,6 @@
|
||||
Adafruit_Blinka==6.16.0
|
||||
adafruit_circuitpython_max31865==2.2.10
|
||||
Flask==1.1.2
|
||||
python-dotenv==0.20.0
|
||||
requests==2.25.1
|
||||
xmpppy==0.7.0
|
14
systemd/temperato-host.service
Normal file
14
systemd/temperato-host.service
Normal file
@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Temperato Host Service
|
||||
|
||||
[Service]
|
||||
Environment=FLASK_APP=web
|
||||
ExecStart=flask run
|
||||
ExecReload=flask run
|
||||
KillMode=process
|
||||
Restart=on-failure
|
||||
Type=simple
|
||||
WorkingDirectory=<your path>
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -2,10 +2,6 @@
|
||||
Description=Temperato Service
|
||||
|
||||
[Service]
|
||||
Environment=NOTIF_URL=<your mattermost incoming webhook>
|
||||
Environment=CHANNEL_ID=<your mattermost channel id>
|
||||
Environment=ACCESS_TOKEN=<your mattermost access token>
|
||||
Environment=MESSAGE=<your mattermost message>
|
||||
ExecStart=python3 temperato.py
|
||||
ExecReload=python3 temperato.py
|
||||
KillMode=process
|
||||
|
@ -23,13 +23,15 @@ import time
|
||||
import os
|
||||
import json
|
||||
import xmpp
|
||||
from dotenv import load_dotenv
|
||||
|
||||
set_point = 82.22
|
||||
load_dotenv()
|
||||
|
||||
set_point = float(os.environ.get('SET_POINT'))
|
||||
sleep_timer = 1
|
||||
tick_threshold = 5
|
||||
|
||||
spi = board.SPI()
|
||||
cs = digitalio.DigitalInOut(board.D26)
|
||||
cs = digitalio.DigitalInOut(getattr(board,os.environ.get('INPUT_PIN')))
|
||||
sensor = adafruit_max31865.MAX31865(spi, cs, wires=3)
|
||||
jid = xmpp.protocol.JID(os.environ.get('XMPP_SENDER'))
|
||||
conn = xmpp.Client(server=jid.getDomain(), debug=False)
|
||||
|
Loading…
Reference in New Issue
Block a user