Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add date for removal of deprecated discovery functions #767

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions pychromecast/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,28 +586,39 @@ def stop_discovery(self):


class CastListener(CastBrowser):
"""Backwards compatible helper class."""
"""Backwards compatible helper class.

Deprecated as of February 2021, will be removed in June 2024.
"""

def __init__(self, add_callback=None, remove_callback=None, update_callback=None):
_LOGGER.info("CastListener is deprecated, update to use CastBrowser instead")
_LOGGER.info(
"CastListener is deprecated and will be removed in June 2024, update to use CastBrowser instead"
)
listener = SimpleCastListener(add_callback, remove_callback, update_callback)
super().__init__(listener)


def start_discovery(cast_browser, zeroconf_instance):
"""Start discovering chromecasts on the network."""
"""Start discovering chromecasts on the network.

Deprecated as of February 2021, will be removed in June 2024.
"""
_LOGGER.info(
"start_discovery is deprecated, call cast_browser.start_discovery() instead"
"start_discovery is deprecated and will be removed in June 2024, call CastBrowser.start_discovery() instead"
)
cast_browser.set_zeroconf_instance(zeroconf_instance)
cast_browser.start_discovery()
return cast_browser


def stop_discovery(cast_browser):
"""Stop the chromecast discovery threads."""
"""Stop the chromecast discovery threads.

Deprecated as of February 2021, will be removed in June 2024.
"""
_LOGGER.info(
"stop_discovery is deprecated, call cast_browser.stop_discovery() instead"
"stop_discovery is deprecated and will be removed in June 2024, call CastBrowser.stop_discovery() instead"
)
cast_browser.stop_discovery()

Expand Down