Skip to content

Commit

Permalink
chore: release v3.0.18
Browse files Browse the repository at this point in the history
local link now respects port and protocol
  • Loading branch information
foxriver76 committed Apr 5, 2021
1 parent 9350f07 commit 316789c
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 23 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ with the ioBroker CLI. You can change the port via `iob set hm-rega.<instance> -
### __WORK IN PROGRESS__
-->

### 3.0.18 (2021-04-05)
* (foxriver76) local link now respects port and protocol

### 3.0.17 (2021-04-04)
* (foxriver76) correctly identify incomplete requests

Expand Down
28 changes: 24 additions & 4 deletions admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,6 @@
}
}

if (settings.username === undefined) settings.username = '';
if (settings.password === undefined) settings.password = '';
if (settings.useHttps === undefined) settings.useHttps = false;

for (var key in settings) {
if (settings.hasOwnProperty(key)) setValue(key, settings[key], onChange);
} // endFor
Expand Down Expand Up @@ -250,6 +246,24 @@
obj[$this.attr('id')] = $this.data('crypt') && $this.val() ? encrypt(secret, $this.val()) : $this.val();
} // endElse
});

const webifPort = parseInt(obj.webinterfacePort)

if (!webifPort || webifPort === 80 || webifPort === 443) {
// if no port set or standard port used - if user specified we do not change
if (obj.useHttps) {
obj.webinterfacePort = 443;
} else {
obj.webinterfacePort = 80;
}
}

if (obj.useHttps) {
obj.webinterfaceProtocol = 'https';
} else {
obj.webinterfaceProtocol = 'http';
}

return obj;
}

Expand Down Expand Up @@ -585,6 +599,12 @@
<input class="value" id="password" data-crypt="1" type="password" disabled>
<label for="password" class="translate">Password</label>
</div>
<div>
<input class="value" id="webinterfacePort" hidden>
</div>
<div>
<input class="value" id="webinterfaceProtocol" hidden>
</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion hm-rega.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ function main() {

rega = new Rega({
ccuIp: adapter.config.homematicAddress,
webinterfacePort: adapter.config.webinterfacePort,
webinterfacePort: adapter.config.webinterfacePort || adapter.config.useHttps ? 443 : 80,
port: adapter.config.homematicPort,
reconnectionInterval: adapter.config.reconnectionInterval,
logger: adapter.log,
Expand Down
31 changes: 16 additions & 15 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"common": {
"name": "hm-rega",
"version": "3.0.17",
"version": "3.0.18",
"news": {
"3.0.18": {
"en": "local link now respects port and protocol",
"de": "Die lokale Verbindung respektiert jetzt Port und Protokoll",
"ru": "локальная ссылка теперь уважает порт и протокол",
"pt": "o link local agora respeita a porta e o protocolo",
"nl": "lokale link respecteert nu poort en protocol",
"fr": "le lien local respecte désormais le port et le protocole",
"it": "il collegamento locale ora rispetta la porta e il protocollo",
"es": "el enlace local ahora respeta el puerto y el protocolo",
"pl": "łącze lokalne obsługuje teraz port i protokół",
"zh-cn": "本地链接现在遵守端口和协议"
},
"3.0.17": {
"en": "correctly identify incomplete requests",
"de": "unvollständige Anfragen korrekt identifizieren",
Expand Down Expand Up @@ -230,18 +242,6 @@
"es": "ahora establecemos el tipo de objeto explícito al extender el objeto",
"pl": "teraz ustawiamy jawny typ obiektu na rozszerzanie obiektu",
"zh-cn": "现在,我们在扩展对象上设置显式对象类型"
},
"2.6.19": {
"en": "fixed issue on syncing service message counter when invisible variables are synchronized",
"de": "Problem beim Synchronisieren des Dienstnachrichtenzählers beim Synchronisieren unsichtbarer Variablen behoben",
"ru": "исправлена проблема с синхронизацией счетчика служебных сообщений при синхронизации невидимых переменных",
"pt": "Foi corrigido o problema de sincronização do contador de mensagens de serviço quando variáveis invisíveis são sincronizadas",
"nl": "probleem opgelost bij het synchroniseren van serviceberichtenteller wanneer onzichtbare variabelen werden gesynchroniseerd",
"fr": "Correction d'un problème sur la synchronisation du compteur de messages de service lorsque les variables invisibles sont synchronisées",
"it": "risolto il problema relativo alla sincronizzazione del contatore dei messaggi del servizio quando le variabili invisibili sono sincronizzate",
"es": "Problema solucionado al sincronizar el contador de mensajes del servicio cuando se sincronizan variables invisibles",
"pl": "naprawiono problem z synchronizacją licznika komunikatów serwisowych, gdy synchronizowane są niewidoczne zmienne",
"zh-cn": "解决了同步不可见变量时同步服务消息计数器的问题"
}
},
"titleLang": {
Expand Down Expand Up @@ -290,7 +290,7 @@
"ccu2"
],
"localLinks": {
"_default": "http://%homematicAddress%"
"_default": "%webinterfaceProtocol%://%homematicAddress%:%webinterfacePort%"
},
"type": "iot-systems",
"connectionType": "local",
Expand Down Expand Up @@ -335,7 +335,8 @@
"password": "",
"useHttps": false,
"showInvSysVar": false,
"webinterfacePort": 0
"webinterfacePort": 80,
"webinterfaceProtocol": "http"
},
"protectedNative": [
"username",
Expand Down
2 changes: 1 addition & 1 deletion lib/rega.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Rega {
if (this.options.ccuIp) {
// if specific webinterface port provided use it, else use default https/http
request({
url: `${this.protocol + this.options.ccuIp}${this.options.webinterfacePort ? `:${this.options.webinterfacePort}` : ''}/ise/checkrega.cgi`,
url: `${this.protocol + this.options.ccuIp}:${this.options.webinterfacePort}/ise/checkrega.cgi`,
strictSSL: false
}, (error, response, body) => {
if (!error && response.statusCode === 200) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.hm-rega",
"version": "3.0.17",
"version": "3.0.18",
"engines": {
"node": ">=10.0.0"
},
Expand Down

0 comments on commit 316789c

Please sign in to comment.