Skip to content

Commit

Permalink
v3.13.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jemu75 committed Apr 25, 2021
1 parent 25d37a8 commit 3c13e30
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fhemapp",
"version": "3.13.4",
"version": "3.13.5",
"private": true,
"author": "jemu75",
"scripts": {
Expand Down
34 changes: 22 additions & 12 deletions src/plugins/fhem.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ class Fhem extends EventEmitter {
deviceList: [],
routeList: [],
header: ''
}
},
hasConnected: []
}
}

Expand Down Expand Up @@ -288,23 +289,31 @@ class Fhem extends EventEmitter {
// subFunction: for getDevices return the connected devices from fhem server
async createConnected(obj) {
let result = {};
let idx = this.app.hasConnected.indexOf(obj.Name);

if(idx == -1) {
this.app.hasConnected.push(obj.Name);

if('connected' in obj.Options) {
let deviceList = Object.keys(obj.Options.connected);
if('connected' in obj.Options) {
let deviceList = Object.keys(obj.Options.connected);

for (const item of deviceList) {
let device = await this.request({ param: 'cmd', value: 'jsonlist2 ' + obj.Options.connected[item] }, 'json');
for (const item of deviceList) {
let device = await this.request({ param: 'cmd', value: 'jsonlist2 ' + obj.Options.connected[item] }, 'json');

if(device && device.Results.length == 1) {
if('PossibleSets' in device.Results[0]) delete device.Results[0].PossibleSets;
if('PossibleAttrs' in device.Results[0]) delete device.Results[0].PossibleAttrs;
if(device && device.Results.length == 1) {
if('PossibleSets' in device.Results[0]) delete device.Results[0].PossibleSets;
if('PossibleAttrs' in device.Results[0]) delete device.Results[0].PossibleAttrs;

let options = await this.createOptions(device.Results[0]);
if(options) device.Results[0].Options = options;
let options = await this.createOptions(device.Results[0]);
if(options) device.Results[0].Options = options;
if(options && device.Results[0].Options.connected) device.Results[0].Connected = await this.createConnected(device.Results[0]);

result[item] = device.Results[0];
result[item] = device.Results[0];
}
}
}
} else {
this.log({ lvl: 1, msg: 'FHEM Device ' + obj.Name + ' is defined as connected device, witch is called from himself. ', meta: obj });
}

return result;
Expand Down Expand Up @@ -343,6 +352,7 @@ class Fhem extends EventEmitter {
let idx = this.app.data.routeList.map((e) => e.route).indexOf(fltr);

this.app.data.deviceList.splice(0);
this.app.hasConnected = [];

if(idx != -1 || fltr.match('device=')) {
let filter = idx != -1 ? this.app.data.routeList[idx].deviceList.join(',') : fltr.replace('device=','').split('&')[0];
Expand Down Expand Up @@ -627,7 +637,7 @@ class Fhem extends EventEmitter {
this.log({ lvl: 2, msg: 'Connection with FHEM is opened.', meta: this.app.connection })

this.app.session.csrf = await this.request({}, 'csrf');
this.log(this.app.session.csrf ? { lvl: 2, msg: 'Crsf-Token received.' } : { lvl: 1, msg: 'No Crsf-Token received.' });
this.log({ lvl: 2, msg: 'Crsf-Token received.', meta: { token: this.app.session.csrf } });

this.loadStructure();
}
Expand Down
2 changes: 1 addition & 1 deletion www/fhemapp/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="de"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><meta name="mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-capable" content="yes"><link rel="icon" href="favicon.png"><link rel="apple-touch-icon" href="apple-touch-icon.png"><title>fhemapp</title><link href="css/chunk-03454508.55c011d2.css" rel="prefetch"><link href="css/chunk-07709945.d4481170.css" rel="prefetch"><link href="css/chunk-085bcd30.01cf6fd8.css" rel="prefetch"><link href="css/chunk-15fa718e.55c011d2.css" rel="prefetch"><link href="css/chunk-28a3f15f.fc346ba4.css" rel="prefetch"><link href="css/chunk-3c9d184f.1bbdaac2.css" rel="prefetch"><link href="css/chunk-46bea2ee.1bbdaac2.css" rel="prefetch"><link href="css/chunk-50f89d12.b490d9b1.css" rel="prefetch"><link href="css/chunk-53c4ff2a.9398bfa8.css" rel="prefetch"><link href="css/chunk-72c6e8d8.d4bef30a.css" rel="prefetch"><link href="css/chunk-dc5178fa.cb4d0868.css" rel="prefetch"><link href="css/chunk-dd03e16c.cb4d0868.css" rel="prefetch"><link href="css/chunk-ecd3142c.86805334.css" rel="prefetch"><link href="js/chunk-03454508.94b22464.js" rel="prefetch"><link href="js/chunk-07709945.536f8338.js" rel="prefetch"><link href="js/chunk-085bcd30.fce1ca94.js" rel="prefetch"><link href="js/chunk-15fa718e.8e403831.js" rel="prefetch"><link href="js/chunk-21b07e80.b3f882b2.js" rel="prefetch"><link href="js/chunk-28a3f15f.fd07f95d.js" rel="prefetch"><link href="js/chunk-2d0aa92c.855dd2bf.js" rel="prefetch"><link href="js/chunk-2d212bf1.e377c778.js" rel="prefetch"><link href="js/chunk-3c9d184f.28dc459c.js" rel="prefetch"><link href="js/chunk-46bea2ee.99e1909a.js" rel="prefetch"><link href="js/chunk-50f89d12.d065ef66.js" rel="prefetch"><link href="js/chunk-53c4ff2a.a3ca272e.js" rel="prefetch"><link href="js/chunk-72c6e8d8.c00175b8.js" rel="prefetch"><link href="js/chunk-dc5178fa.4891b2bc.js" rel="prefetch"><link href="js/chunk-dd03e16c.f4db6a88.js" rel="prefetch"><link href="js/chunk-ecd3142c.0688a723.js" rel="prefetch"><link href="css/chunk-vendors.95431e8e.css" rel="preload" as="style"><link href="js/app.561e4ccc.js" rel="preload" as="script"><link href="js/chunk-vendors.b9a283db.js" rel="preload" as="script"><link href="css/chunk-vendors.95431e8e.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but fhemapp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.b9a283db.js"></script><script src="js/app.561e4ccc.js"></script></body></html>
<!DOCTYPE html><html lang="de"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><meta name="mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-capable" content="yes"><link rel="icon" href="favicon.png"><link rel="apple-touch-icon" href="apple-touch-icon.png"><title>fhemapp</title><link href="css/chunk-03454508.55c011d2.css" rel="prefetch"><link href="css/chunk-07709945.d4481170.css" rel="prefetch"><link href="css/chunk-085bcd30.01cf6fd8.css" rel="prefetch"><link href="css/chunk-15fa718e.55c011d2.css" rel="prefetch"><link href="css/chunk-28a3f15f.fc346ba4.css" rel="prefetch"><link href="css/chunk-3c9d184f.1bbdaac2.css" rel="prefetch"><link href="css/chunk-46bea2ee.1bbdaac2.css" rel="prefetch"><link href="css/chunk-50f89d12.b490d9b1.css" rel="prefetch"><link href="css/chunk-53c4ff2a.9398bfa8.css" rel="prefetch"><link href="css/chunk-72c6e8d8.d4bef30a.css" rel="prefetch"><link href="css/chunk-dc5178fa.cb4d0868.css" rel="prefetch"><link href="css/chunk-dd03e16c.cb4d0868.css" rel="prefetch"><link href="css/chunk-ecd3142c.86805334.css" rel="prefetch"><link href="js/chunk-03454508.94b22464.js" rel="prefetch"><link href="js/chunk-07709945.536f8338.js" rel="prefetch"><link href="js/chunk-085bcd30.fce1ca94.js" rel="prefetch"><link href="js/chunk-15fa718e.8e403831.js" rel="prefetch"><link href="js/chunk-21b07e80.b3f882b2.js" rel="prefetch"><link href="js/chunk-28a3f15f.fd07f95d.js" rel="prefetch"><link href="js/chunk-2d0aa92c.855dd2bf.js" rel="prefetch"><link href="js/chunk-2d212bf1.e377c778.js" rel="prefetch"><link href="js/chunk-3c9d184f.28dc459c.js" rel="prefetch"><link href="js/chunk-46bea2ee.99e1909a.js" rel="prefetch"><link href="js/chunk-50f89d12.d065ef66.js" rel="prefetch"><link href="js/chunk-53c4ff2a.a3ca272e.js" rel="prefetch"><link href="js/chunk-72c6e8d8.c00175b8.js" rel="prefetch"><link href="js/chunk-dc5178fa.4891b2bc.js" rel="prefetch"><link href="js/chunk-dd03e16c.f4db6a88.js" rel="prefetch"><link href="js/chunk-ecd3142c.0688a723.js" rel="prefetch"><link href="css/chunk-vendors.95431e8e.css" rel="preload" as="style"><link href="js/app.c5a09590.js" rel="preload" as="script"><link href="js/chunk-vendors.b9a283db.js" rel="preload" as="script"><link href="css/chunk-vendors.95431e8e.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but fhemapp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.b9a283db.js"></script><script src="js/app.c5a09590.js"></script></body></html>
1 change: 0 additions & 1 deletion www/fhemapp/js/app.561e4ccc.js

This file was deleted.

1 change: 1 addition & 0 deletions www/fhemapp/js/app.c5a09590.js

Large diffs are not rendered by default.

0 comments on commit 3c13e30

Please sign in to comment.