@@ -296,7 +296,7 @@ define(['app'], function (app) {
296
296
}
297
297
else if (
298
298
( text . indexOf ( "LAN" ) >= 0 && ( ( text . indexOf ( "YouLess" ) >= 0 ) || ( text . indexOf ( "Denkovi" ) >= 0 ) ) ) ||
299
- ( text . indexOf ( "Satel Integra" ) >= 0 ) || ( text . indexOf ( "Harmony" ) >= 0 ) || ( text . indexOf ( "Xiaomi Gateway" ) >= 0 )
299
+ ( text . indexOf ( "Satel Integra" ) >= 0 ) || ( text . indexOf ( "Harmony" ) >= 0 ) || ( text . indexOf ( "Xiaomi Gateway" ) >= 0 ) || ( text . indexOf ( "MyHome OpenWebNet with LAN interface" ) >= 0 )
300
300
)
301
301
{
302
302
var address = $ ( "#hardwarecontent #divremote #tcpaddress" ) . val ( ) ;
@@ -327,7 +327,15 @@ define(['app'], function (app) {
327
327
}
328
328
Mode1 = pollinterval ;
329
329
}
330
- var password = encodeURIComponent ( $ ( "#hardwarecontent #divlogin #password" ) . val ( ) ) ;
330
+ var password = encodeURIComponent ( $ ( "#hardwarecontent #divlogin #password" ) . val ( ) ) ;
331
+ if ( text . indexOf ( "MyHome OpenWebNet with LAN interface" ) >= 0 ) {
332
+ if ( password != "" ) {
333
+ if ( ( isNaN ( password ) ) || ( password . length < 5 ) ) /* must be a number */ {
334
+ ShowNotify ( $ . t ( 'Please enter a numeric password of at least 5 characters' ) , 2500 , true ) ;
335
+ return ;
336
+ }
337
+ }
338
+ }
331
339
$ . ajax ( {
332
340
url : "json.htm?type=command¶m=updatehardware&htype=" + hardwaretype +
333
341
"&address=" + address +
@@ -776,56 +784,6 @@ define(['app'], function (app) {
776
784
ShowNotify ( $ . t ( 'Problem updating hardware!' ) , 2500 , true ) ;
777
785
}
778
786
} ) ;
779
- }
780
- else if ( text . indexOf ( "MyHome OpenWebNet with LAN interface" ) >= 0 )
781
- {
782
- var address = $ ( "#hardwarecontent #divremote #tcpaddress" ) . val ( ) ;
783
- if ( address == "" )
784
- {
785
- ShowNotify ( $ . t ( 'Please enter an Address!' ) , 2500 , true ) ;
786
- return ;
787
- }
788
- var port = $ ( "#hardwarecontent #divremote #tcpport" ) . val ( ) ;
789
- if ( port == "" )
790
- {
791
- ShowNotify ( $ . t ( 'Please enter an Port!' ) , 2500 , true ) ;
792
- return ;
793
- }
794
- var intRegex = / ^ \d + $ / ;
795
- if ( ! intRegex . test ( port ) ) {
796
- ShowNotify ( $ . t ( 'Please enter an Valid Port!' ) , 2500 , true ) ;
797
- return ;
798
- }
799
-
800
- var password = encodeURIComponent ( $ ( "#hardwarecontent #divlogin #password" ) . val ( ) ) ;
801
- if ( password != "" )
802
- {
803
- if ( ( isNaN ( password ) ) || ( password . length < 5 ) ) /* must be a number */
804
- {
805
- ShowNotify ( $ . t ( 'Please enter a numeric password of at least 5 characters' ) , 2500 , true ) ;
806
- return ;
807
- }
808
- }
809
-
810
- $ . ajax ( {
811
- url : "json.htm?type=command¶m=updatehardware&htype=" + hardwaretype +
812
- "&address=" + address +
813
- "&port=" + port +
814
- "&password=" + encodeURIComponent ( password ) +
815
- "&name=" + encodeURIComponent ( name ) +
816
- "&enabled=" + bEnabled +
817
- "&idx=" + idx +
818
- "&datatimeout=" + datatimeout +
819
- "&Mode1=" + Mode1 + "&Mode2=" + Mode2 + "&Mode3=" + Mode3 + "&Mode4=" + Mode4 + "&Mode5=" + Mode5 + "&Mode6=" + Mode6 ,
820
- async : false ,
821
- dataType : 'json' ,
822
- success : function ( data ) {
823
- RefreshHardwareTable ( ) ;
824
- } ,
825
- error : function ( ) {
826
- ShowNotify ( $ . t ( 'Problem updating hardware!' ) , 2500 , true ) ;
827
- }
828
- } ) ;
829
787
}
830
788
else if ( text . indexOf ( "Goodwe solar inverter via Web" ) >= 0 )
831
789
{
@@ -971,7 +929,8 @@ define(['app'], function (app) {
971
929
text . indexOf ( "KMTronic" ) == - 1
972
930
&& text . indexOf ( "MQTT" ) == - 1 &&
973
931
text . indexOf ( "Satel Integra" ) == - 1 &&
974
- text . indexOf ( "Razberry" ) == - 1
932
+ text . indexOf ( "Razberry" ) == - 1 &&
933
+ text . indexOf ( "MyHome OpenWebNet with LAN interface" ) == - 1
975
934
)
976
935
)
977
936
{
@@ -1153,7 +1112,8 @@ define(['app'], function (app) {
1153
1112
}
1154
1113
else if (
1155
1114
( text . indexOf ( "LAN" ) >= 0 && ( ( text . indexOf ( "YouLess" ) >= 0 ) || ( text . indexOf ( "Denkovi" ) >= 0 ) ) ) ||
1156
- ( text . indexOf ( "Satel Integra" ) >= 0 ) || ( text . indexOf ( "Harmony" ) >= 0 ) || ( text . indexOf ( "Xiaomi Gateway" ) >= 0 )
1115
+ ( text . indexOf ( "Satel Integra" ) >= 0 ) || ( text . indexOf ( "Harmony" ) >= 0 ) || ( text . indexOf ( "Xiaomi Gateway" ) >= 0 ) ||
1116
+ ( text . indexOf ( "MyHome OpenWebNet with LAN interface" ) >= 0 )
1157
1117
)
1158
1118
{
1159
1119
var address = $ ( "#hardwarecontent #divremote #tcpaddress" ) . val ( ) ;
@@ -1183,7 +1143,15 @@ define(['app'], function (app) {
1183
1143
}
1184
1144
Mode1 = pollinterval ;
1185
1145
}
1186
- var password = encodeURIComponent ( $ ( "#hardwarecontent #divlogin #password" ) . val ( ) ) ;
1146
+ var password = encodeURIComponent ( $ ( "#hardwarecontent #divlogin #password" ) . val ( ) ) ;
1147
+ if ( text . indexOf ( "MyHome OpenWebNet with LAN interface" ) >= 0 ) {
1148
+ if ( password != "" ) {
1149
+ if ( ( isNaN ( password ) ) || ( password . length < 5 ) ) /* must be a number */ {
1150
+ ShowNotify ( $ . t ( 'Please enter a numeric password of at least 5 characters' ) , 2500 , true ) ;
1151
+ return ;
1152
+ }
1153
+ }
1154
+ }
1187
1155
$ . ajax ( {
1188
1156
url : "json.htm?type=command¶m=addhardware&htype=" + hardwaretype + "&address=" + address + "&port=" + port + "&name=" + encodeURIComponent ( name ) + "&password=" + encodeURIComponent ( password ) + "&enabled=" + bEnabled + "&datatimeout=" + datatimeout + "&Mode1=" + Mode1 ,
1189
1157
async : false ,
@@ -1500,49 +1468,6 @@ define(['app'], function (app) {
1500
1468
}
1501
1469
} ) ;
1502
1470
}
1503
- else if ( text . indexOf ( "MyHome OpenWebNet with LAN interface" ) >= 0 )
1504
- {
1505
- var address = $ ( "#hardwarecontent #divremote #tcpaddress" ) . val ( ) ;
1506
- if ( address == "" )
1507
- {
1508
- ShowNotify ( $ . t ( 'Please enter an Address!' ) , 2500 , true ) ;
1509
- return ;
1510
- }
1511
- var port = $ ( "#hardwarecontent #divremote #tcpport" ) . val ( ) ;
1512
- if ( port == "" )
1513
- {
1514
- ShowNotify ( $ . t ( 'Please enter an Port!' ) , 2500 , true ) ;
1515
- return ;
1516
- }
1517
- var intRegex = / ^ \d + $ / ;
1518
- if ( ! intRegex . test ( port ) ) {
1519
- ShowNotify ( $ . t ( 'Please enter an Valid Port!' ) , 2500 , true ) ;
1520
- return ;
1521
- }
1522
- var password = encodeURIComponent ( $ ( "#hardwarecontent #divlogin #password" ) . val ( ) ) ;
1523
- if ( password != "" )
1524
- {
1525
- if ( ( isNaN ( password ) ) || ( password . length < 5 ) ) /* must be a number */
1526
- {
1527
- ShowNotify ( $ . t ( 'Please enter a numeric password of at least 5 characters' ) , 2500 , true ) ;
1528
- return ;
1529
- }
1530
- }
1531
-
1532
- $ . ajax ( {
1533
- url : "json.htm?type=command¶m=addhardware&htype=" + hardwaretype + "&address=" + address + "&port=" + port +
1534
- "&password=" + encodeURIComponent ( password ) +
1535
- "&name=" + encodeURIComponent ( name ) + "&enabled=" + bEnabled + "&datatimeout=" + datatimeout ,
1536
- async : false ,
1537
- dataType : 'json' ,
1538
- success : function ( data ) {
1539
- RefreshHardwareTable ( ) ;
1540
- } ,
1541
- error : function ( ) {
1542
- ShowNotify ( $ . t ( 'Problem adding hardware!' ) , 2500 , true ) ;
1543
- }
1544
- } ) ;
1545
- }
1546
1471
else if ( text . indexOf ( "Goodwe solar inverter via Web" ) >= 0 )
1547
1472
{
1548
1473
var username = $ ( "#hardwarecontent #divgoodweweb #username" ) . val ( ) ;
@@ -4919,15 +4844,15 @@ define(['app'], function (app) {
4919
4844
}
4920
4845
}
4921
4846
}
4922
- else if ( ( ( ( data [ "Type" ] . indexOf ( "LAN" ) >= 0 ) || data [ "Type" ] . indexOf ( "MySensors Gateway with MQTT" ) >= 0 ) && ( data [ "Type" ] . indexOf ( "YouLess" ) == - 1 ) && ( data [ "Type" ] . indexOf ( "Denkovi" ) == - 1 ) && ( data [ "Type" ] . indexOf ( "Satel Integra" ) == - 1 ) ) || ( data [ "Type" ] . indexOf ( "Domoticz" ) >= 0 ) || ( data [ "Type" ] . indexOf ( "Harmony" ) >= 0 ) ) {
4847
+ else if ( ( ( ( data [ "Type" ] . indexOf ( "LAN" ) >= 0 ) || data [ "Type" ] . indexOf ( "MySensors Gateway with MQTT" ) >= 0 ) && ( data [ "Type" ] . indexOf ( "YouLess" ) == - 1 ) && ( data [ "Type" ] . indexOf ( "Denkovi" ) == - 1 ) && ( data [ "Type" ] . indexOf ( "Satel Integra" ) == - 1 ) && ( data [ "Type" ] . indexOf ( "MyHome OpenWebNet with LAN interface" ) == - 1 ) ) || ( data [ "Type" ] . indexOf ( "Domoticz" ) >= 0 ) || ( data [ "Type" ] . indexOf ( "Harmony" ) >= 0 ) ) {
4923
4848
$ ( "#hardwarecontent #hardwareparamsremote #tcpaddress" ) . val ( data [ "Address" ] ) ;
4924
4849
$ ( "#hardwarecontent #hardwareparamsremote #tcpport" ) . val ( data [ "Port" ] ) ;
4925
4850
if ( data [ "Type" ] . indexOf ( "P1 Smart Meter" ) >= 0 )
4926
4851
{
4927
4852
$ ( "#hardwarecontent #divcrcp1 #disablecrcp1" ) . prop ( "checked" , data [ "Mode2" ] == 0 ) ;
4928
4853
}
4929
4854
}
4930
- else if ( ( ( ( data [ "Type" ] . indexOf ( "LAN" ) >= 0 ) || data [ "Type" ] . indexOf ( "MySensors Gateway with MQTT" ) >= 0 ) && ( data [ "Type" ] . indexOf ( "YouLess" ) >= 0 ) ) || ( data [ "Type" ] . indexOf ( "Domoticz" ) >= 0 ) || ( data [ "Type" ] . indexOf ( "Denkovi" ) >= 0 ) || ( data [ "Type" ] . indexOf ( "Satel Integra" ) >= 0 ) || ( data [ "Type" ] . indexOf ( "Logitech Media Server" ) >= 0 ) || ( data [ "Type" ] . indexOf ( "HEOS by DENON" ) >= 0 ) || ( data [ "Type" ] . indexOf ( "Xiaomi Gateway" ) >= 0 ) ) {
4855
+ else if ( ( ( ( data [ "Type" ] . indexOf ( "LAN" ) >= 0 ) || data [ "Type" ] . indexOf ( "MySensors Gateway with MQTT" ) >= 0 ) && ( data [ "Type" ] . indexOf ( "YouLess" ) >= 0 ) ) || ( data [ "Type" ] . indexOf ( "Domoticz" ) >= 0 ) || ( data [ "Type" ] . indexOf ( "Denkovi" ) >= 0 ) || ( data [ "Type" ] . indexOf ( "Satel Integra" ) >= 0 ) || ( data [ "Type" ] . indexOf ( "Logitech Media Server" ) >= 0 ) || ( data [ "Type" ] . indexOf ( "HEOS by DENON" ) >= 0 ) || ( data [ "Type" ] . indexOf ( "Xiaomi Gateway" ) >= 0 ) || ( data [ "Type" ] . indexOf ( "MyHome OpenWebNet with LAN interface" ) >= 0 ) ) {
4931
4856
$ ( "#hardwarecontent #hardwareparamsremote #tcpaddress" ) . val ( data [ "Address" ] ) ;
4932
4857
$ ( "#hardwarecontent #hardwareparamsremote #tcpport" ) . val ( data [ "Port" ] ) ;
4933
4858
$ ( "#hardwarecontent #hardwareparamslogin #password" ) . val ( data [ "Password" ] ) ;
0 commit comments