generated from Synteraction-Lab/TemplateRepository
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_notification.py
33 lines (25 loc) · 1.22 KB
/
test_notification.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
# coding=utf-8
import notification_data
import device_config
import utilities
DEVICE_IP = device_config.get_device_ip()
DISPLAY_URL = 'http://' + DEVICE_IP + ':8080/displays/10/'
def display_all_notifications(all_notifications):
count = 0
while count < len(all_notifications):
notification_data = all_notifications[count].copy()
if notification_data.get('text_long') is not None:
utilities.send_request(DISPLAY_URL, notification_data.get('text_long'))
utilities.sleep_seconds(4)
if notification_data.get('image_long') is not None:
utilities.send_request(DISPLAY_URL, notification_data.get('image_long'))
utilities.sleep_seconds(4)
if notification_data.get('text_short') is not None:
utilities.send_request(DISPLAY_URL, notification_data.get('text_short'))
utilities.sleep_seconds(4)
if notification_data.get('image_short') is not None:
utilities.send_request(DISPLAY_URL, notification_data.get('image_short'))
utilities.sleep_seconds(4)
count += 1
utilities.send_request(DISPLAY_URL, {"subheading": ""})
display_all_notifications(notification_data.get_all_testing_notifications())