Hi,
I started using HABApp (Version 24.11.1) icw OH (4.1.3).
First off: a big thank you to Sebastian [Spaceman_Spiff] for making this plugin available. Being able to use a modern python to write scripts + use a debugger while doing so makes a lot of difference. I really appreciate this, so: Thank You!
I have a question though: I am writing a rule that powers an (OpenHASP) display.
In this rule, I have several event handlers (started through event_listen()) that monitor MQTT topics and in response they update other MQTT topics in the background.
I notice that it happens, especially during development, that when the Rule restarts/reloads, the old event handlers that were installed during previous instance of that Rule are still active. The new instance re-creates these event listeners, and before I know it, I have a lot of duplicate event listeners in the background, and they can step on each other as they all try to alter the same mqtt topicsā¦
I have added some hacks and I can programmatically detect when this happened. But I seem to find no way of fixing the situation. I already tried just exiting the whole python program, using sys.exit() or plain exit() but that has no effect. (HABApp just keeps running) (*)
I did see in the docs that there is a HABApp.Rule.on_rule_removed(), but I cannot seem to find how to remove the event listeners that were installed by the Rule.
Does anyone know how to do this?
thanks & br, Johan.
(*) just to clarify : the intention of exiting the program would be to let the OS detect the process exit and start a new HABApp process. A brute-force way to get rid of the orphaned event handlersā¦