mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Get cast type and manufacturer via http protocol (#68863)
This commit is contained in:
parent
0dcaa6422d
commit
cf39a61aa1
@ -39,9 +39,17 @@ class ChromecastInfo:
|
|||||||
|
|
||||||
Uses blocking HTTP / HTTPS.
|
Uses blocking HTTP / HTTPS.
|
||||||
"""
|
"""
|
||||||
|
cast_info = self.cast_info
|
||||||
|
if self.cast_info.cast_type is None or self.cast_info.manufacturer is None:
|
||||||
|
# Manufacturer and cast type is not available in mDNS data, get it over http
|
||||||
|
cast_info = dial.get_cast_type(
|
||||||
|
cast_info,
|
||||||
|
zconf=ChromeCastZeroconf.get_zeroconf(),
|
||||||
|
)
|
||||||
|
|
||||||
if not self.is_audio_group or self.is_dynamic_group is not None:
|
if not self.is_audio_group or self.is_dynamic_group is not None:
|
||||||
# We have all information, no need to check HTTP API.
|
# We have all information, no need to check HTTP API.
|
||||||
return self
|
return ChromecastInfo(cast_info=cast_info)
|
||||||
|
|
||||||
# Fill out missing group information via HTTP API.
|
# Fill out missing group information via HTTP API.
|
||||||
is_dynamic_group = False
|
is_dynamic_group = False
|
||||||
@ -57,7 +65,7 @@ class ChromecastInfo:
|
|||||||
)
|
)
|
||||||
|
|
||||||
return ChromecastInfo(
|
return ChromecastInfo(
|
||||||
cast_info=self.cast_info,
|
cast_info=cast_info,
|
||||||
is_dynamic_group=is_dynamic_group,
|
is_dynamic_group=is_dynamic_group,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user