subscribeMessage resubscribing being sent before custom integration endpoint is loaded
zachowj opened this issue · comments
I am using subscribeMessage
to hit an endpoint that's created from a custom integration. Now that HA allows connections before all integrations are loaded I am running into the issue where the resubscribing of these endpoints, after a reboot of HA, is being sent before the integration has been loaded. This is causing the subscription message to be lost and an Unhandled promise rejection
to be thrown.
Is allowing subscribeMessage
to accept an additional parameter to disable resubscription a viable solution or is there another option I am missing? Am I at the point of needing to roll my own HA WebSocket client?
Ah, unexpected side effect 🙂
I wonder if we can either built-in an error handling logic that can wait till the system is started or that we should just built that exact logic in.
In my case leaving it up to the user to resend the message allows me to registered entities with HA as soon as the integration is loaded and not have to wait for HA to be in a running state. This might not be ideal in all use cases. Either option would resolve this issue.