-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathESPushoverMessage.cpp
91 lines (69 loc) · 1.83 KB
/
ESPushoverMessage.cpp
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#include "ESPushoverMessage.h"
ESPushoverMessage::ESPushoverMessage(String message) {
_message = message;
}
void ESPushoverMessage::setDevice(String device) {
_device = device;
}
void ESPushoverMessage::setTitle(String title) {
_title = title;
}
void ESPushoverMessage::setUrl(String url) {
_url = url;
}
void ESPushoverMessage::setUrlTitle(String url_title) {
_url_title = url_title;
}
void ESPushoverMessage::setPriority(Pushoverpriorities priority) {
_priority = priority;
}
void ESPushoverMessage::setRetry(uint16_t retry) {
_retry = retry;
}
void ESPushoverMessage::setExpire(uint16_t expire) {
_expire = expire;
}
void ESPushoverMessage::setTimestamp(uint32_t timestamp) {
_timestamp = timestamp;
}
void ESPushoverMessage::setIsHTML(boolean ishtml) {
_ishtml = ishtml;
}
void ESPushoverMessage::setSound(Pushoversounds sound) {
_sound = sound;
}
String ESPushoverMessage::getMessage() {
return _message;
}
String ESPushoverMessage::getDevice() {
return _device;
}
String ESPushoverMessage::getTitle() {
return _title;
}
String ESPushoverMessage::getUrl() {
return _url;
}
String ESPushoverMessage::getUrlTitle() {
return _url_title;
}
int8_t ESPushoverMessage::getPriority() {
int8_t priorities[5] = { 0, -2, -1, 1, 2 };
return priorities[_priority];
}
uint16_t ESPushoverMessage::getRetry() {
return _retry;
}
uint16_t ESPushoverMessage::getExpire() {
return _expire;
}
uint32_t ESPushoverMessage::getTimestamp() {
return _timestamp;
}
boolean ESPushoverMessage::getIsHTML() {
return _ishtml;
}
String ESPushoverMessage::getSound() {
String sounds[22] = { "pushover", "bike", "bugle", "cashregister", "classical", "cosmic", "falling", "gamelan", "incoming", "intermission", "magic", "mechanical", "pianobar", "siren", "spacealarm", "tugboat", "alien", "climb", "peristent", "echo", "updown", "none" };
return sounds[_sound];
}