-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass the width and height when requesting camera images #9683
Conversation
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This reverts commit 63db402.
ae4e9f9
to
247436b
Compare
hass: HomeAssistant, | ||
entityId: string, | ||
...args: unknown[] | ||
...args: any[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is working with width
and height
but I had to change the typing here. Not sure this it the best solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried locally but couldn't figure it out. It's all good.
One thing I did just realize after I merged it (ofc), we will cache by entity ID and not by width/height. So there might be cases where a user caches a smaller image and so the new bigger location will serve from the cache. |
We don't cache these files, otherwise the image would never move |
Thanks. I thought it might have something to do with #9690 merged in to my test branch, but that didn't make sense. |
Well we do cache within the session, but not in another screen/window/refresh, and we also only cache for 9 seconds... So it could be an issue if you have the same entity on your page twice in different sizes I guess... |
To fix that, we should replace |
I'll open something for that shortly |
|
Proposed change
Pass the width and height when requesting camera images
Requires home-assistant/core#53835
Testing:
Additional improvement would be to not update cameras that are not inside the viewport, but that is outside the scope of this PR because even with this change there are timeouts on slow 3g (#9690).
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: