I stumbled upon an issue where the current channel subscription is lost and self._current_channel is never updated again. Steps to reproduce:
start on the Live TV app
switch input to HDMI
go back to Live TV
In that case self._current_channel would stay on the channel that has been set during step 1. Seems like the ep.GET_CURRENT_CHANNEL subscription is lost when the TV switches from Live TV to an HDMI input.
With this pull request the current channel subscription is restored when the TV is switched back to Live TV.
The time.sleep seems to be necessary because an immediate setting of the current channel subscription as soon as set_current_app_state is called does not work (I suspect an race condition somewhere?). Let me know in case there is a better way!
I stumbled upon an issue where the current channel subscription is lost and self._current_channel is never updated again. Steps to reproduce:
In that case self._current_channel would stay on the channel that has been set during step 1. Seems like the ep.GET_CURRENT_CHANNEL subscription is lost when the TV switches from Live TV to an HDMI input. With this pull request the current channel subscription is restored when the TV is switched back to Live TV. The time.sleep seems to be necessary because an immediate setting of the current channel subscription as soon as set_current_app_state is called does not work (I suspect an race condition somewhere?). Let me know in case there is a better way!