Skip to content

Commit

Permalink
fixed image not updating if connection to ds or cam is lost;
Browse files Browse the repository at this point in the history
fixed cam sizes if cams with and without positions are mixed
  • Loading branch information
Tom-Hirschberger committed May 2, 2020
1 parent d946ccc commit 56ea7d7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
13 changes: 10 additions & 3 deletions MMM-SynologySurveillance.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,17 @@ Module.register('MMM-SynologySurveillance', {
if(typeof this.dsStreamInfo[payload.dsIdx] !== "undefined") {
var updated = false
for(var curKey in Object.keys(this.dsStreamInfo[payload.dsIdx])){
if(this.dsStreamInfo[payload.dsIdx][curKey] !== payload.camStreams[curKey]){
this.dsStreamInfo[payload.dsIdx] = payload.camStreams
this.updateDom(this.config.animationSpeed)
if(typeof payload.camStreams[curKey] !== "undefined"){
if(this.dsStreamInfo[payload.dsIdx][curKey] !== payload.camStreams[curKey]){
this.dsStreamInfo[payload.dsIdx] = payload.camStreams
this.updateDom(this.config.animationSpeed)
console.log("URL of cam: "+curKey+" changed. Updating view!")
updated = true
break
}
} else {
console.log("URL of cam: "+curKey+" changed. Updating view!")
this.dsStreamInfo[payload.dsIdx] = {}
updated = true
break
}
Expand Down
16 changes: 13 additions & 3 deletions node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,27 @@ module.exports = NodeHelper.create({

self.urlUpdateInProgress = false
self.sendSocketNotification("DS_STREAM_INFO",curPayload)
} else {
self.sendSocketNotification("DS_STREAM_INFO",{
dsIdx: curDsIdx,
camStreams: {},
})
}
// else {
// console.log(JSON.stringify(liveViewError))
// }
});
} else {
console.log("Could not find any valid cam for ds with idx: "+curDsIdx)
self.sendSocketNotification("DS_STREAM_INFO",{
dsIdx: curDsIdx,
camStreams: {},
})
}
} else if (error){
console.log("Problem during fetch of cams of ds with idx: "+curDsIdx)
console.log(JSON.stringify(error, null, 2))
self.sendSocketNotification("DS_STREAM_INFO",{
dsIdx: curDsIdx,
camStreams: {},
})
}
})
}
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": "MMM-SynologySurveillance",
"version": "0.0.4",
"version": "0.0.5",
"description": "",
"main": "MMM-SynologySurveillance.js",
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions synology-surveillance_h.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
}

.innerPositionWrapper {
min-height: calc(var(--position-size) + 20px);
justify-content: center;
align-items: center;
display: flex;
Expand Down
1 change: 1 addition & 0 deletions synology-surveillance_v.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
}

.innerPositionWrapper {
min-height: calc(var(--position-size) + 10px);
justify-content: center;
align-items: center;
display: flex;
Expand Down

0 comments on commit 56ea7d7

Please sign in to comment.