Skip to content

Commit

Permalink
Add date for removal of deprecated discovery functions (#767)
Browse files Browse the repository at this point in the history
* Add date for removal of deprecated discovery functions

* Format code
  • Loading branch information
emontnemery committed Nov 21, 2023
1 parent 308ad17 commit f095de6
Showing 1 changed file with 17 additions and 6 deletions.
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

0 comments on commit f095de6

Please sign in to comment.