Conversation
|
For the sake of completeness should we have a de-register callback too? Should there be a different event for "rename"? Can you open a proof on concept on the HA side too? |
| def _set_data_flag_bit(self, index, value): | ||
| print("foo") | ||
|
|
||
| def add_on_removed_observer(self, observer): |
There was a problem hiding this comment.
technically it is both add and remove so the name is a bit off
There was a problem hiding this comment.
This is actually just remove. Chicken/egg for added.
There was a problem hiding this comment.
Meaning if you’re adding a callback for added on a program...the program is already added (in the context of a program instance).
There was a problem hiding this comment.
yea but you have both "added" and "removed" "events". Maybe just add_observer?
There was a problem hiding this comment.
The event on the program directly is only removed..
|
The controller callback serves both added and removed. For simplicity I think it would be difficult try to manage a rename/modify event and would probably stick with a modify is a remove and subsequent add. |
|
Kudos, SonarCloud Quality Gate passed!
|








This allows registering callbacks for 2 different scenarios:
Example usage:
The callback directly on the
programwill make it easier to bind anentityto the removal process and deregister the entity withhassin a more self-contained manner.