forked from BrandinGrindstaff/GMpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackageTest.py
executable file
·30 lines (24 loc) · 925 Bytes
/
packageTest.py
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
26
27
28
29
#!/usr/bin/env python3
from GMPi_Pack import Sense
from GMPi_Pack import UploadFile
from GMPi_Pack import PicSnap
from GMPi_Pack import SlackAlert
from GMPi_Pack import ReadConfig
config = ReadConfig()
filepath = config["output_path"]
rcloneProfile = config["rclone_profile"]
whichDHT = config["which_dht"]
whichDataPin = config["which_data_pin"]
minLight = float(config["minimum_light_threshold"])
maxLight = float(config["maximum_light_threshold"])
print( "Light Perameters Set")
print('Max is: {}'.format(maxLight))
print('Min is: {}'.format(minLight))
#OpenFile(filepath)
#sense also returns current light intensity value, possiably others in the future.
sense_out = Sense(filepath, whichDHT, whichDataPin)
if (sense_out["lux"] < minLight or sense_out["lux"] > maxLight):
SlackAlert(config["slack_webhook"], "Light")
print('LightAlert sent')
#UploadFile(filepath, rcloneProfile)
#PicSnap(filepath, rcloneProfile)