When developing, it's common to have a production instance and at least one test instance of Home Assistant running at the same time.
Without the changes in this PR, once Home Assistant Cast has been used once, the HomeAssistantController instance is never unregistered by Home Assistant Core. This means the 'HomeAssistantController`s are interfering with each other, even when they are not actively casting.
With the changes in this PR, we detect this and call a callback passed to us by Home Assistant Core, asking to unregister the controller.
When developing, it's common to have a production instance and at least one test instance of Home Assistant running at the same time.
Without the changes in this PR, once Home Assistant Cast has been used once, the
HomeAssistantController
instance is never unregistered by Home Assistant Core. This means the 'HomeAssistantController`s are interfering with each other, even when they are not actively casting.With the changes in this PR, we detect this and call a callback passed to us by Home Assistant Core, asking to unregister the controller.