Skip to content

Commit

Permalink
Energymanagment added (ISG plus required)
Browse files Browse the repository at this point in the history
  • Loading branch information
unltdnetworx committed Sep 11, 2018
1 parent b4ad747 commit 3d79d4b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Help or hints are welcome.

## Changelog

### 1.1.0
* Energymanagment added (ISG plus required)

### 1.0.3
* bugfix in version number

Expand Down
6 changes: 5 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"common": {
"name": "stiebel-isg",
"version": "1.0.3",
"version": "1.1.0",
"news": {
"1.1.0": {
"en": "Energymanagment added (ISG plus required)",
"de": "Energymanagment hinzugefügt (ISG plus erforderlich)"
},
"1.0.3": {
"en": "bugfix in version number",
"de": "Bugfix in version"
Expand Down
13 changes: 10 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let isgIntervall;
let isgCommandIntervall;
var jar;
let host;
const commandPaths = ["/?s=0","/?s=4,0,0","/?s=4,0,1","/?s=4,0,2","/?s=4,0,3","/?s=4,0,4","/?s=4,0,5","/?s=4,1,0","/?s=4,1,1","/?s=4,2,0","/?s=4,2,1","/?s=4,2,2","/?s=4,2,4","/?s=4,2,6","/?s=4,2,3","/?s=4,2,5","/?s=4,2,7"];
const commandPaths = ["/?s=0","/?s=4,0,0","/?s=4,0,1","/?s=4,0,2","/?s=4,0,3","/?s=4,0,4","/?s=4,0,5","/?s=4,1,0","/?s=4,1,1","/?s=4,2,0","/?s=4,2,1","/?s=4,2,2","/?s=4,2,4","/?s=4,2,6","/?s=4,2,3","/?s=4,2,5","/?s=4,2,7","/?s=4,3"];
const valuePaths = ["/?s=1,0","/?s=1,1"];

const request = require('request');
Expand Down Expand Up @@ -264,6 +264,7 @@ function getIsgCommands(sidePath) {
.replace(/[\u00df]+/g,"SS");

let submenu = $.html().match(/#subnavactivename"\).html\('(.*?)'/);
let submenupath = "";

//Get values from script, because JavaScript isn't running with cheerio.
$('#werte').find("input").each(function(i, el) {
Expand Down Expand Up @@ -314,7 +315,10 @@ function getIsgCommands(sidePath) {
}
})
statesCommand += "}";
createISGCommands(translateName("settings") + "." + group + "." + submenu[1], idCommand, nameCommand, "number","","level",valCommand,statesCommand,"","");
if(submenu){
submenupath += "." + submenu[1];
}
createISGCommands(translateName("settings") + "." + group + submenupath, idCommand, nameCommand, "number","","level",valCommand,statesCommand,"","");
})
} else {
let scriptValues = $(el)
Expand All @@ -333,7 +337,10 @@ function getIsgCommands(sidePath) {
let unitCommand = $(el).parent().parent().find('.append-1').text();

if(idCommand){
createISGCommands(translateName("settings") + "." + group + "." + submenu[1], idCommand[1], nameCommand, "number",unitCommand,"state",valCommand[1],"",minCommand[1],maxCommand[1]);
if(submenu){
submenupath += "." + submenu[1];
}
createISGCommands(translateName("settings") + "." + group + submenupath, idCommand[1], nameCommand, "number",unitCommand,"state",valCommand[1],"",minCommand[1],maxCommand[1]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.stiebel-isg",
"version": "1.0.3",
"version": "1.1.0",
"description": "stiebel/tecalor internet service gateway",
"author": {
"name": "Michael Schuster",
Expand Down

0 comments on commit 3d79d4b

Please sign in to comment.