You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In gVars class added flag "temp_in_fahrenheit". In second example modified algorithm to display the temperature sensor value in degrees Celsius or in degrees Fahrenheit depending the flag.
See lines 211 , 667-670 and 725-726.
Copy file name to clipboardExpand all lines: examples/hotplug_sensor_examples/displayio_layout_tablayout_hotplug_temp_sensor_datetime_fm_NTP_touch_and_gVars_test.py
+20-19Lines changed: 20 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,7 @@ def __init__(self):
69
69
25: "five_min_cnt",
70
70
26: "next_NTP_sync_t1",
71
71
27: "next_NTP_sync_t3",
72
+
28: "temp_in_fahrenheit",
72
73
}
73
74
74
75
self.gVars_rDict= {
@@ -100,6 +101,7 @@ def __init__(self):
100
101
"five_min_cnt": 25,
101
102
"next_NTP_sync_t1": 26,
102
103
"next_NTP_sync_t3": 27,
104
+
"temp_in_fahrenheit": 28,
103
105
}
104
106
105
107
self.g_vars= {}
@@ -161,6 +163,7 @@ def clean(self):
161
163
25: None,
162
164
26: None,
163
165
27: None,
166
+
28: None,
164
167
}
165
168
166
169
deflist(self):
@@ -213,6 +216,7 @@ def list(self):
213
216
myVars.write("five_min_cnt", 0)
214
217
myVars.write("next_NTP_sync_t1", "Next NTP sync in ")
215
218
myVars.write("next_NTP_sync_t3", " (mm:ss)")
219
+
myVars.write("temp_in_fahrenheit", True)
216
220
# nHH_old is used to check if the hour has changed.
0 commit comments