Skip to content

Commit

Permalink
Re-add support for passing services to get_device_info + get_multizon…
Browse files Browse the repository at this point in the history
…e_status (#558)
  • Loading branch information
emontnemery authored Nov 15, 2021
1 parent a30cca3 commit c7aba57
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pychromecast/dial.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def get_cast_type(cast_info, zconf=None, timeout=30, context=None):


def get_device_info( # pylint: disable=too-many-locals
host, zconf=None, timeout=30, context=None
host, services=None, zconf=None, timeout=30, context=None
):
"""
:param host: Hostname or ip to fetch status from
Expand All @@ -157,7 +157,8 @@ def get_device_info( # pylint: disable=too-many-locals
"""

try:
services = [ServiceInfo(SERVICE_TYPE_HOST, (host, 8009))]
if services is None:
services = [ServiceInfo(SERVICE_TYPE_HOST, (host, 8009))]
status = _get_status(
services,
zconf,
Expand Down Expand Up @@ -227,7 +228,7 @@ def _get_group_info(host, group):
return MultizoneInfo(name, uuid, leader_host, leader_port)


def get_multizone_status(host, zconf=None, timeout=30, context=None):
def get_multizone_status(host, services=None, zconf=None, timeout=30, context=None):
"""
:param host: Hostname or ip to fetch status from
:type host: str
Expand All @@ -236,7 +237,8 @@ def get_multizone_status(host, zconf=None, timeout=30, context=None):
"""

try:
services = [ServiceInfo(SERVICE_TYPE_HOST, (host, 8009))]
if services is None:
services = [ServiceInfo(SERVICE_TYPE_HOST, (host, 8009))]
status = _get_status(
services,
zconf,
Expand Down

0 comments on commit c7aba57

Please sign in to comment.