hass-lovelace-kindle-screensaver: Crash when connection is refused
If the server to fetch the lovelace screen from isn’t up, the hass-lovelace-kindle-screensaver docker process crashes, which is inconvenient. This happens for me when the host system (which runs both Home Assistant and h-l-k-s) reboots.
It would be better if it waits a minute and tries again, and repeats until successful.
(node:26) UnhandledPromiseRejectionWarning: Error: net::ERR_CONNECTION_REFUSED at http://XXXX:8123
at navigate (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:115:23)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async FrameManager.navigateFrame (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:90:21)
at async Frame.goto (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:417:16)
at async Page.goto (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:784:16)
at async /app/index.js:36:3
(node:26) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:26) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 21 (13 by maintainers)
Hey @lanrat, thanks for your fork and the changes you made there.
Do you see any chance that we can get features into this repository via a PR? Ideally without dropping any features so e.g. users can decide whether to use MQTT or HTTP reporting to Home Assistant?
I can understand that it was easier for you to make a fork and adapt it to your needs. However, I don’t think most people will want to build their own docker image and make it available to their devices, as most just run Portainer on Hass.io itself. I think everyone can benefit from this if we can merge the best solutions together.
I’d appreciate if you think this is possible and would love to invest some time in merging pieces of your code. I for myself don’t have that much time to develop this project in the next month, but would love to look over code and help testing so I can support this process as good as I can.
Let me know what you think and feel free to create a PR whenever you think it makes sense 😊 thank you!
@aptonline I just enabled issues. Thanks for letting me know!
@sibbl , @lanrat as a user, and someone who has now tried both versions of each project, it would be really great to see a combination of both feature sets in one release but also do understand the time constraints for both of you.
@lanrat would it be possible to enable issue tracking on your repositories as although I have it installed there are a number things that I don’t have working (MQTT discovery for one) and I don’t feel it’s right posting about them here 🤣.
Correct. You need to build it yourself. Just run
make
.I have a modified version of that too: https://github.com/lanrat/hass-kindle-screensaver
The readme has not been fully updated yet.
I changed all metadata being reported to the server to use HTTP headers instead of query parameters. And I use MQTT Discovery to automatically report the data to Home Assistant.
It also has a better index page with stats/info on the screenshots and devices connected.
I’ve fixed this in my fork (as well as lots of other changes) by having the code sleep for a bit and then retry when it can’t reach Home Assistant. I’ve found it greatly helps performance to not have the docker container constantly being restarted just because Home Assistant is down.
https://github.com/lanrat/hass-screenshot