Backwards compatible WSGI camera fix
This commit is contained in:
parent
a0a2299d1a
commit
44ca449de5
|
@ -51,8 +51,9 @@ export default new Polymer({
|
|||
},
|
||||
|
||||
updateCameraFeedSrc(stateObj) {
|
||||
const attr = stateObj.attributes;
|
||||
const time = (new Date()).getTime();
|
||||
this.cameraFeedSrc = `${stateObj.attributes.entity_picture}?time=${time}`;
|
||||
this.cameraFeedSrc = `${attr.entity_picture}?token=${attr.access_token}&time=${time}`;
|
||||
},
|
||||
|
||||
imageLoadSuccess() {
|
||||
|
|
|
@ -17,7 +17,8 @@ export default new Polymer({
|
|||
if (__DEMO__) {
|
||||
return '/demo/webcam.jpg';
|
||||
} else if (stateObj) {
|
||||
return `/api/camera_proxy_stream/${this.stateObj.entityId}`;
|
||||
return `/api/camera_proxy_stream/${stateObj.entityId}` +
|
||||
`?token=${stateObj.attributes.access_token}`;
|
||||
}
|
||||
// Return an empty image if no stateObj (= dialog not open)
|
||||
return 'data:image/gif;base64,R0lGODlhAQABAAAAACw=';
|
||||
|
|
Loading…
Reference in New Issue