File tree 3 files changed +39
-1
lines changed
3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ public Notification build() {
131
131
.setColor (options .getColor ());
132
132
133
133
if (ledColor != 0 ) {
134
- builder .setLights (ledColor , 100 , 100 );
134
+ builder .setLights (ledColor , options . getLedOnTime (), options . getLedOffTime () );
135
135
}
136
136
137
137
if (sound != null ) {
Original file line number Diff line number Diff line change @@ -250,6 +250,42 @@ public int getLedColor() {
250
250
return aRGB + 0xFF000000 ;
251
251
}
252
252
253
+ /**
254
+ * @return
255
+ * The time that the LED should be on (in milliseconds).
256
+ */
257
+ public int getLedOnTime () {
258
+ String timeOn = options .optString ("ledOnTime" , null );
259
+
260
+ if (timeOn == null ) {
261
+ return 1000 ;
262
+ }
263
+
264
+ try {
265
+ return Integer .parseInt (timeOn );
266
+ } catch (NumberFormatException e ) {
267
+ return 1000 ;
268
+ }
269
+ }
270
+
271
+ /**
272
+ * @return
273
+ * The time that the LED should be off (in milliseconds).
274
+ */
275
+ public int getLedOffTime () {
276
+ String timeOff = options .optString ("ledOffTime" , null );
277
+
278
+ if (timeOff == null ) {
279
+ return 1000 ;
280
+ }
281
+
282
+ try {
283
+ return Integer .parseInt (timeOff );
284
+ } catch (NumberFormatException e ) {
285
+ return 1000 ;
286
+ }
287
+ }
288
+
253
289
/**
254
290
* @return
255
291
* The notification background color for the small icon
Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ exports.applyPlatformSpecificOptions = function () {
68
68
defaults . ongoing = false ;
69
69
defaults . autoClear = true ;
70
70
defaults . led = undefined ;
71
+ defaults . ledOnTime = undefined ;
72
+ defaults . ledOffTime = undefined ;
71
73
defaults . color = undefined ;
72
74
break ;
73
75
}
You can’t perform that action at this time.
0 commit comments