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

Remove get_chromecasts_as_dict #138

Merged
merged 1 commit into from Dec 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -40,7 +40,7 @@ How to use
>> import time
>> import pychromecast

>> pychromecast.get_chromecasts_as_dict().keys()
>> [cc.device.friendly_name for cc in pychromecast.get_chromecasts()]
['Dev', 'Living Room', 'Den', 'Bedroom']

>> cast = pychromecast.get_chromecast(friendly_name="Living Room")
Expand Down
21 changes: 1 addition & 20 deletions pychromecast/__init__.py
Expand Up @@ -19,7 +19,7 @@

__all__ = (
'__version__', '__version_info__',
'get_chromecasts', 'get_chromecasts_as_dict', 'get_chromecast',
'get_chromecasts', 'get_chromecast',
'Chromecast'
)
__version_info__ = ('0', '7', '6')
Expand Down Expand Up @@ -168,25 +168,6 @@ def internal_stop():
return internal_stop


def get_chromecasts_as_dict(tries=None, retry_wait=None, timeout=None,
blocking=True, **filters):
"""
Returns a dictionary of chromecasts with the friendly name as
the key. The value is the pychromecast object itself.

Tries is specified if you want to limit the number of times the
underlying socket associated with your Chromecast objects will
retry connecting if connection is lost or it fails to connect
in the first place. The number of seconds spent between each retry
can be defined by passing the retry_wait parameter, the default is
to wait 5 seconds.
"""
return {cc.device.friendly_name: cc
for cc in get_chromecasts(tries=tries, retry_wait=retry_wait,
timeout=timeout, blocking=blocking,
**filters)}


# pylint: disable=too-many-arguments,too-many-branches
def get_chromecast(strict=False, tries=None, retry_wait=None, timeout=None,
blocking=True, callback=None, **filters):
Expand Down