@@ -13,8 +13,19 @@ Configure the required pushsafer settings in your mh.private.ini file:
13
13
Pushsafer_t = "MisterHouse" Default title for messages if none provided
14
14
Pushsafer_d = <Default device or device group id to send notifications to>
15
15
Pushsafer_i = <Default icon>
16
+ Pushsafer_c = <Default iconcolor>
16
17
Pushsafer_s = <Default sound>
17
18
Pushsafer_v = <Default vibration>
19
+ Pushsafer_l = <Default time2live>
20
+ Pushsafer_u = <Default url>
21
+ Pushsafer_ut = <Default urltitle>
22
+ Pushsafer_pr = <Default priority>
23
+ Pushsafer_re = <Default retry>
24
+ Pushsafer_ex = <Default expire>
25
+ Pushsafer_cr = <Default confirm>
26
+ Pushsafer_a = <Default answer>
27
+ Pushsafer_ao = <Default answeroptions>
28
+ Pushsafer_af = <Default answerforce>
18
29
Pushsafer_disable = 1 Disable notifications. Messages will still be logged
19
30
20
31
Create a pushsafer instance in the .mht file, or in user code:
@@ -32,8 +43,19 @@ A user code file overriding parameters normally specified in mh.private.ini. A
32
43
t => 'Home Notification',
33
44
d => '111',
34
45
i => '11',
46
+ c => '#FF0000',
35
47
s => '5',
36
48
v => '1',
49
+ l => '',
50
+ u => 'https://www.pushsafer.com',
51
+ ut => 'Open Pushsafer',
52
+ pr => '0',
53
+ re => '',
54
+ ex => '',
55
+ cr => '',
56
+ a => '1',
57
+ ao => 'yes|no|maybe',
58
+ af => '1',
37
59
});
38
60
39
61
@@ -94,13 +116,24 @@ Creates a new Pushsafer object. The parameter hash is optional. Defaults will b
94
116
B<This must be excluded from the primary misterhouse loop, or the acknowledgment checking and duplicate message rate limiting will be lost >
95
117
96
118
my $push = Pushsafer->new( {
97
- k => "xxxx...", # Set the Private or Alias Key
98
- t => "Some title", # Set default title for messages
99
- d => "111", # Set the target device or device group (leaving this unset goes to all devices)
100
- i => "5", # Set the icon to be displayed
101
- s => "3", # Set the sound to be played
102
- v => "1", # Set the vibration to be played
103
- speak => 1, # Enable or disable speak of notifications and acknowledgment
119
+ k => "xxxx...", # Set the Private or Alias Key
120
+ t => "Some title", # Set default title for messages
121
+ d => "111", # Set the target device or device group (leaving this unset goes to all devices)
122
+ i => "5", # Set the icon to be displayed
123
+ c => "#FF0000", # Set the color of icon to be displayed
124
+ s => "3", # Set the sound to be played
125
+ v => "1", # Set the vibration to be played
126
+ l => "", # Set the Time in minutes, after a message automatically gets purged.
127
+ u => 'https://www.pushsafer.com', # Set the URL.
128
+ ut => 'Open Pushsafer', # Set the Title of URL.
129
+ pr => '0', # Set the Priority.
130
+ re => '', # Set the Retry.
131
+ ex => '', # Set the Expire.
132
+ cr => '', # Set the Confirm.
133
+ a => '1', # Set the Answer.
134
+ ao => 'yes|no|maybe', # Set the Answer Options.
135
+ af => '1', # Set the Force Answer.
136
+ speak => 1, # Enable or disable speak of notifications and acknowledgment
104
137
});
105
138
106
139
Any of these parameters may be specified in mh.private.ini by prefixing them with "Pushsafer_"
@@ -122,7 +155,7 @@ sub new {
122
155
$self -> {speak } = 1; # Speak notifications and acknowledgements
123
156
124
157
# Merge the mh.private.ini defaults into the object
125
- foreach (qw( k t d i s v speak disable) ) {
158
+ foreach (qw( k t d i c s v l u ut pr re ex cr a ao af speak disable) ) {
126
159
$self -> {$_ } = $params -> {$_ };
127
160
$self -> {$_ } = $: :config_parms{" Pushsafer_$_ " } unless defined $self -> {$_ };
128
161
}
@@ -153,12 +186,12 @@ This is the primary method of the Pushsafer object. The message text is the onl
153
186
154
187
The optional parameter hash can be used to override defaults, or specify additional
155
188
information for the notification. The list is not exclusive. Additional parameters will be passed
156
- in the POST to Pushsafer.com. This allows support of any API parameter as defined at https://pushsafer.net /api
189
+ in the POST to Pushsafer.com. This allows support of any API parameter as defined at https://www. pushsafer.com /api
157
190
158
191
$push->notify("Some urgent message", {
159
- k => "xxxx...", # Override the Private or Alias Key
160
- t => "Some title", # Override title of message
161
- d => "1111" # Device or device-group id
192
+ k => "xxxx...", # Override the Private or Alias Key
193
+ t => "Some title", # Override title of message
194
+ d => "1111" # Device or device-group id
162
195
});
163
196
164
197
Notify will record the last message sent along with a timestamp. If the duplicate message is sent within
@@ -197,7 +230,7 @@ sub notify {
197
230
}
198
231
199
232
# Merge in the message defaults, They can be overridden
200
- foreach (qw( k t d i s v ) ) {
233
+ foreach (qw( k t d i c s v l u ut pr re ex cr a ao af ) ) {
201
234
next unless ( defined $self -> {$_ } );
202
235
$callparms -> {$_ } = $self -> {$_ } unless defined $callparms -> {$_ };
203
236
}
0 commit comments