Skip to content

Commit

Permalink
Reset receiver controller on connection lost (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery authored Jun 28, 2020
1 parent 60d267d commit 58937f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pychromecast/socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ def _check_connection(self):
reset = True

if reset:
self.receiver_controller.disconnected()
for channel in self._open_channels:
self.disconnect_channel(channel)
self._report_connection_status(
Expand Down Expand Up @@ -1078,6 +1079,11 @@ def __init__(self, cast_type=CAST_TYPE_CHROMECAST):
self._status_listeners = []
self._launch_error_listeners = []

def disconnected(self):
""" Called when disconnected. Will erase status. """
self.logger.info("Receiver:channel_disconnected")
self.status = None

@property
def app_id(self):
""" Convenience method to retrieve current app id. """
Expand Down

0 comments on commit 58937f0

Please sign in to comment.