Skip to content

Commit 0e8ec59

Browse files
committed
Add Kodi notifications
1 parent f0f41f3 commit 0e8ec59

23 files changed

+54
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ notifications/NotificationProwl.cpp
242242
notifications/NotificationPushover.cpp
243243
notifications/NotificationPushalot.cpp
244244
notifications/NotificationSMS.cpp
245+
notifications/NotificationKodi.cpp
245246
smtpclient/SMTPClient.cpp
246247
tcpserver/TCPClient.cpp
247248
tcpserver/TCPServer.cpp

notifications/NotificationHelper.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "NotificationEmail.h"
1010
#include "NotificationSMS.h"
1111
#include "NotificationHTTP.h"
12+
#include "NotificationKodi.h"
1213
#include <map>
1314

1415
#if defined WIN32
@@ -26,6 +27,7 @@ CNotificationHelper::CNotificationHelper()
2627
AddNotifier(new CNotificationEmail());
2728
AddNotifier(new CNotificationSMS());
2829
AddNotifier(new CNotificationHTTP());
30+
AddNotifier(new CNotificationKodi());
2931
/* more notifiers can be added here */
3032
}
3133

www/app/SetupController.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ define(['app'], function (app) {
118118
}
119119
extraparams = "EmailServer=" + EmailServer + "&EmailPort=" + EmailPort + "&EmailFrom=" + EmailFrom + "&EmailTo=" + EmailTo + "&EmailUsername=" + EmailUsername + "&EmailPassword=" + EmailPassword;
120120
break;
121+
case "kodi":
122+
if ($("#koditable #KodiIPAddress").val() == "") $("#koditable #KodiIPAddress").val("224.0.0.1");
123+
if (($("#koditable #KodiPort").val() == "") || !$.isNumeric($("#koditable #KodiPort").val())) $("#koditable #KodiPort").val("9777");
124+
if (($("#koditable #KodiTimeToLive").val() == "") || !$.isNumeric($("#koditable #KodiTimeToLive").val())) $("#koditable #KodiTimeToLive").val("1");
125+
extraparams = 'KodiIPAddress=' + $("#koditable #KodiIPAddress").val() + '&KodiPort=' + $("#koditable #KodiPort").val() + "&KodiTimeToLive=" + $("#koditable #KodiTimeToLive").val();
126+
break;
121127
default:
122128
return;
123129
}
@@ -128,7 +134,7 @@ define(['app'], function (app) {
128134
success: function(data) {
129135
if (data.status != "OK") {
130136
HideNotify();
131-
if (subsystem=="http") {
137+
if ((subsystem=="http") || (subsystem=="kodi")) {
132138
ShowNotify($.t('Problem Sending Notification'), 3000, true);
133139
}
134140
else {
@@ -268,6 +274,22 @@ define(['app'], function (app) {
268274
$("#httptable #HTTPURL").val(atob(data.HTTPURL));
269275
}
270276

277+
if (typeof data.KodiEnabled != 'undefined') {
278+
$("#koditable #KodiEnabled").prop('checked',data.KodiEnabled==1);
279+
}
280+
$("#koditable #KodiIPAddress").val("224.0.0.1");
281+
if (typeof data.KodiIPAddress != 'undefined') {
282+
$("#koditable #KodiIPAddress").val(data.KodiIPAddress);
283+
}
284+
$("#koditable #KodiPort").val("9777");
285+
if (typeof data.KodiPort != 'undefined') {
286+
$("#koditable #KodiPort").val(data.KodiPort);
287+
}
288+
$("#koditable #KodiTimeToLive").val("1");
289+
if (typeof data.KodiTimeToLive != 'undefined') {
290+
$("#koditable #KodiTimeToLive").val(data.KodiTimeToLive);
291+
}
292+
271293
if (typeof data.LightHistoryDays != 'undefined') {
272294
$("#lightlogtable #LightHistoryDays").val(data.LightHistoryDays);
273295
}

www/i18n/domoticz-bg.json.gz

56 Bytes
Binary file not shown.

www/i18n/domoticz-cs.json.gz

53 Bytes
Binary file not shown.

www/i18n/domoticz-de.json.gz

52 Bytes
Binary file not shown.

www/i18n/domoticz-el.json.gz

54 Bytes
Binary file not shown.

www/i18n/domoticz-en.json.gz

53 Bytes
Binary file not shown.

www/i18n/domoticz-es.json.gz

54 Bytes
Binary file not shown.

www/i18n/domoticz-fi.json.gz

58 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)