zachowj / hass-node-red

Companion Component for node-red-contrib-home-assistant-websocket to help integrate Node-RED with Home Assistant Core
MIT License
442 stars 181 forks source link

Fix failure during loading due to MQTT init #239

Closed zvirja closed 6 months ago

zvirja commented 6 months ago

Fixes #238

Add MQTT to dependencies to make sure that component is loaded after it, so initialization does not fail

zachowj commented 6 months ago

https://developers.home-assistant.io/docs/creating_integration_manifest/#after-dependencies

zvirja commented 6 months ago

@zachowj Yeah, also saw that hint in the CI output. Brilliant!! I've tested it locally and it seems to work as a charm :blush:

zvirja commented 6 months ago

@zachowj I believe that I fixed the ordering the that validation will be fine. I however don't know why the test is failing - it does not seem to be related to the change I did. Could you please help with that?

Thank you!

zachowj commented 6 months ago

Yeah, testing is broken at the moment. Your latest push removed the previous commit code.

zvirja commented 6 months ago

Yeah, I force pushed to clean up the mess and the previous approach I took. Feel free to add more to PR if needed - I am done :blush:

zachowj commented 6 months ago

Oh sorry, I didn't follow. I thought awaiting for the mqtt to load was still needed in the setup, but I guess after_dependences handles that outside the code.

zachowj commented 6 months ago

thx

zvirja commented 6 months ago

Exactly, now HASS does it for us, so the fix is neat. If you find other issues like this - simply add them as well to after_deps - that should be scalable until you add all of them!

Thank you very much for the fast feedback loop. I appreciate it a lot! :heart: