-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
63 lines (53 loc) · 2.25 KB
/
config.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import os
#: Both token values need to be provided
#: I created another config file:
#:
#: ___________
#: | secret.py |
#: |___________|__________________________________________
#: | |
#: | TELEGRAM_API_TOKEN=<TELEGRAM_API_TOKEN> |
#: | OWNER_ACTIVATION_TOKEN=<OWNER_ACTIVATION_TOKEN> |
#: | ... |
#: |______________________________________________________|
#:
#:
#: And adjusted the config.py:
#: ___________
#: | config.py |
#: |___________|__________________________________________
#: | |
#: | TELEGRAM_API_TOKEN=secret.TELEGRAM_API_TOKEN |
#: | OWNER_ACTIVATION_TOKEN=secret.OWNER_ACTIVATION_TOKEN |
#: | ... |
#: |______________________________________________________|
#:
TELEGRAM_API_TOKEN='<TELEGRAM_API_TOKEN>'
OWNER_ACTIVATION_TOKEN='<OWNER_ACTIVATION_TOKEN>'
#: GPIO-Pin for motion-detection
#: Attention: GPIO 4 -> Pin 7
#: Research `Raspberry Pi Zero Pinout` for more information
SENSOR_PIN=4
#: Adjust buffer to keep video going without motion
#: The motion sensor stays on for around 2 seconds after the last movement
#: Every step is roughly 1 second
#: BUFFER_TIME_STEPS=2 would therefore result in around 4 seconds buffer time
#: meaning that the recording will be stopped if for 4 seconds no motion is detected
BUFFER_TIME_STEPS=2
#: Set a max video length since long videos may cause problems while sending
#: This is no exact time, because its done using time.sleep()
#: The rest of the program also takes time
#: MAX_VIDEO_LENGTH=30 results in videos with around 33 to 36 seconds
MAX_VIDEO_LENGTH=30
#: Path to current directory
FILE_PATH=os.path.abspath(__file__).rsplit('/', 1)[0]
#: Name of directory in which the videos will be saved
VIDEO_DIR='videos'
#: PiCamera records in .h264
CAMERA_RECORDING_FORMAT='.h264'
#: But .mp4 is causing less problems with compatibility
CAMERA_CONVERTING_FORMAT='.mp4'
#: Length of user activation tokens
#: With uppercase letters and digits and a length of 12 there are 4738381338321616896 possible tokens
#: I reduced it to 8, 2821109907456 options should do just fine
ACTIVATION_TOKEN_LENGTH=8