From 3c8701d8081e5ac5d255eb1d2afdcc54da57e902 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 21 Nov 2023 21:27:50 +0100 Subject: [PATCH 1/2] Add date for removal of deprecated discovery functions --- pychromecast/discovery.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pychromecast/discovery.py b/pychromecast/discovery.py index 11a25ea98..13e88da6d 100644 --- a/pychromecast/discovery.py +++ b/pychromecast/discovery.py @@ -586,18 +586,24 @@ 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() @@ -605,9 +611,12 @@ def start_discovery(cast_browser, zeroconf_instance): 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() From ca2e35e01bea185db910fb6de670860df62eb19b Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 21 Nov 2023 21:41:54 +0100 Subject: [PATCH 2/2] Format code --- pychromecast/discovery.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pychromecast/discovery.py b/pychromecast/discovery.py index 13e88da6d..2e007a142 100644 --- a/pychromecast/discovery.py +++ b/pychromecast/discovery.py @@ -592,7 +592,9 @@ class CastListener(CastBrowser): """ def __init__(self, add_callback=None, remove_callback=None, update_callback=None): - _LOGGER.info("CastListener is deprecated and will be removed in June 2024, 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)