sibbl / hass-lovelace-kindle-screensaver

This tool generates a png from a Home Assistant Lovelace view, which can be displayed on a Kindle device which has the Online Screensaver plugin installed.
MIT License
311 stars 71 forks source link

Add option to reset zoom? #40

Closed mitchsurp closed 2 years ago

mitchsurp commented 2 years ago

When using the kiosk javascript (?kiosk at the end of a URL) in HomeAssistant, many browsers including node-js will be default render a bar at the top where the header would normally be. You can see this in my work-in-progress here.

energy3

This sacrifices around 10% of the image. The only way I've found to fix this in any browser is to zoom (in or out, it doesn't matter) and then reset to default. The bar goes away and the image fills the entire frame. This is entirely reproducible by loading kiosk.js (maykar/kiosk-mode) and accessing a URL with ?kiosk appended.

Is there any way to build an option to do this?

sibbl commented 2 years ago

Hi @mitchsurp,

I can recommend setting your lovelace view to "panel" view in the tab's settings. This will allow you to only have one single card within the view, which then has no borders/paddings/margins at its sides. This single component can then be a vertical stack card.

I hope this helps!

PS: I saw that the kiosk-mode extension was discontinued without any reason or replacement. Probably we might look into some alternative anyway which could also fix this.

mitchsurp commented 2 years ago

I did find a way to fix this. It turns out that kiosk mode was abandoned or forked, and a new version created in HACS. This version loads without the bar. This is no longer an issue.

sibbl commented 1 year ago

@mitchsurp thanks for the update! I also was looking for a replacement for the archived old kiosk mode extension. I guess this is the one you now use? https://github.com/NemesisRE/kiosk-mode

I'll also update it in my readmes.