mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 20:36:35 +00:00
Backwards compatible WSGI camera fix
This commit is contained in:
parent
a0a2299d1a
commit
44ca449de5
@ -51,8 +51,9 @@ export default new Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
updateCameraFeedSrc(stateObj) {
|
updateCameraFeedSrc(stateObj) {
|
||||||
|
const attr = stateObj.attributes;
|
||||||
const time = (new Date()).getTime();
|
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() {
|
imageLoadSuccess() {
|
||||||
|
@ -17,7 +17,8 @@ export default new Polymer({
|
|||||||
if (__DEMO__) {
|
if (__DEMO__) {
|
||||||
return '/demo/webcam.jpg';
|
return '/demo/webcam.jpg';
|
||||||
} else if (stateObj) {
|
} 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 an empty image if no stateObj (= dialog not open)
|
||||||
return 'data:image/gif;base64,R0lGODlhAQABAAAAACw=';
|
return 'data:image/gif;base64,R0lGODlhAQABAAAAACw=';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user