-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
display_prototype.py
executable file
·61 lines (52 loc) · 1.9 KB
/
display_prototype.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
#!/usr/bin/env python3
# *****************************************
# PiFire Display Prototype Interface Library
# *****************************************
#
# Description: This library simulates a display.
#
# *****************************************
# *****************************************
# Imported Libraries
# *****************************************
class Display:
def __init__(self, units='F'):
self.DisplaySplash()
self.units = units
def DisplayStatus(self, in_data, status_data):
units = status_data['units']
print('====[Display]=====')
print('* Grill Temp: ' + str(in_data['GrillTemp'])[:5] + units)
print('* Grill SetPoint: ' + str(in_data['GrillSetPoint']) + units)
print('* Probe1 Temp: ' + str(in_data['Probe1Temp'])[:5] + units)
print('* Probe1 SetPoint: ' + str(in_data['Probe1SetPoint']) + units)
print('* Probe2 Temp: ' + str(in_data['Probe2Temp'])[:5] + units)
print('* Probe2 SetPoint: ' + str(in_data['Probe2SetPoint']) + units)
print('* Mode: ' + str(status_data['mode']))
notification = False
for item in status_data['notify_req']:
if status_data['notify_req'][item] == True:
notification = True
if notification == True:
print('* Notifications: True')
for item in status_data['outpins']:
if status_data['outpins'][item] == 0:
print('* ' + str(item) + ' ON')
print('==================')
def DisplaySplash(self):
print(' ( (')
print(' )\ ) )\ )')
print(' (()/( ( (()/( ( ( (')
print(' /(_)))\ /(_)) )\ )( ))\ ')
print(' (_)) ((_)(_))_|((_)(()\ /((_) ')
print(' | _ \ (_)| |_ (_) ((_)(_)) ')
print(' | _/ | || __| | || \'_|/ -_) ')
print(' |_| |_||_| |_||_| \___| ')
def ClearDisplay(self):
print('[Display] Clear Display Command Sent')
def DisplayText(self, text):
print('====[Display]=====')
print('* Text: ' + str(text))
print('==================')
def EventDetect(self):
return()