PyChromecast 14.0.9__tar.gz → 14.0.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pychromecast-14.0.9 → pychromecast-14.0.10}/PKG-INFO +1 -1
- {pychromecast-14.0.9 → pychromecast-14.0.10}/PyChromecast.egg-info/PKG-INFO +1 -1
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/__init__.py +1 -1
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/const.py +2 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/media.py +3 -3
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/receiver.py +1 -1
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/discovery.py +1 -1
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/error.py +4 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/models.py +1 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/socket_client.py +12 -4
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pyproject.toml +9 -4
- {pychromecast-14.0.9 → pychromecast-14.0.10}/requirements.txt +1 -1
- {pychromecast-14.0.9 → pychromecast-14.0.10}/LICENSE +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/MANIFEST.in +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/PyChromecast.egg-info/SOURCES.txt +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/PyChromecast.egg-info/dependency_links.txt +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/PyChromecast.egg-info/not-zip-safe +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/PyChromecast.egg-info/requires.txt +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/PyChromecast.egg-info/top_level.txt +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/README.rst +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/config.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/__init__.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/bbciplayer.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/bbcsounds.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/bubbleupnp.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/dashcast.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/heartbeat.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/homeassistant.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/homeassistant_media.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/multizone.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/nrkradio.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/nrktv.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/plex.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/shaka.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/supla.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/yleareena.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/youtube.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/dial.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/generated/authority_keys_pb2.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/generated/authority_keys_pb2.pyi +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/generated/cast_channel_pb2.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/generated/cast_channel_pb2.pyi +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/generated/logging_pb2.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/generated/logging_pb2.pyi +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/generated/readme.txt +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/py.typed +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/quick_play.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/response_handler.py +0 -0
- {pychromecast-14.0.9 → pychromecast-14.0.10}/setup.cfg +0 -0
|
@@ -371,7 +371,7 @@ class Chromecast(CastStatusListener):
|
|
|
371
371
|
or self.app_id in (None, IDLE_APP_ID)
|
|
372
372
|
or (
|
|
373
373
|
self.cast_type == CAST_TYPE_CHROMECAST
|
|
374
|
-
and
|
|
374
|
+
and self.status.is_active_input is False
|
|
375
375
|
and not self.ignore_cec
|
|
376
376
|
)
|
|
377
377
|
)
|
|
@@ -57,6 +57,7 @@ CAST_TYPES = {
|
|
|
57
57
|
"jbl link portable": (CAST_TYPE_AUDIO, MF_HARMAN),
|
|
58
58
|
"lenovocd-24502f": (CAST_TYPE_AUDIO, MF_LENOVO),
|
|
59
59
|
"lenovo smart display 7": (CAST_TYPE_CHROMECAST, MF_LENOVO),
|
|
60
|
+
"lenovo smart display 10": (CAST_TYPE_CHROMECAST, MF_LENOVO),
|
|
60
61
|
"lg wk7 thinq speaker": (CAST_TYPE_AUDIO, MF_LG),
|
|
61
62
|
"marshall stanmore ii": (CAST_TYPE_AUDIO, MF_MARSHALL),
|
|
62
63
|
"mitv-mssp2": (CAST_TYPE_CHROMECAST, MF_XIAOMI),
|
|
@@ -69,6 +70,7 @@ CAST_TYPES = {
|
|
|
69
70
|
"svs pro soundbase": (CAST_TYPE_AUDIO, MF_SVS),
|
|
70
71
|
"tpm191e": (CAST_TYPE_CHROMECAST, MF_PHILIPS),
|
|
71
72
|
"v705-h3": (CAST_TYPE_CHROMECAST, MF_VIZIO),
|
|
73
|
+
"d24f-j09": (CAST_TYPE_CHROMECAST, MF_VIZIO),
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
|
|
@@ -4,7 +4,7 @@ on the Chromecast.
|
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
import abc
|
|
7
|
-
from datetime import datetime
|
|
7
|
+
from datetime import datetime, timezone
|
|
8
8
|
from dataclasses import dataclass
|
|
9
9
|
import logging
|
|
10
10
|
import threading
|
|
@@ -153,7 +153,7 @@ class MediaStatus:
|
|
|
153
153
|
return (
|
|
154
154
|
self.current_time
|
|
155
155
|
+ self.playback_rate
|
|
156
|
-
* (datetime.
|
|
156
|
+
* (datetime.now(timezone.utc) - self.last_updated).total_seconds()
|
|
157
157
|
)
|
|
158
158
|
# Not playing, return last reported seek time
|
|
159
159
|
return self.current_time
|
|
@@ -336,7 +336,7 @@ class MediaStatus:
|
|
|
336
336
|
self.current_subtitle_tracks = status_data.get(
|
|
337
337
|
"activeTrackIds", self.current_subtitle_tracks
|
|
338
338
|
)
|
|
339
|
-
self.last_updated = datetime.
|
|
339
|
+
self.last_updated = datetime.now(timezone.utc)
|
|
340
340
|
|
|
341
341
|
def __repr__(self) -> str:
|
|
342
342
|
info = {
|
|
@@ -286,7 +286,7 @@ class ReceiverController(BaseController):
|
|
|
286
286
|
is_audio = cast_type in (CAST_TYPE_AUDIO, CAST_TYPE_GROUP)
|
|
287
287
|
|
|
288
288
|
status = CastStatus(
|
|
289
|
-
status_data.get("isActiveInput"
|
|
289
|
+
status_data.get("isActiveInput"),
|
|
290
290
|
status_data.get("isStandBy", None if is_audio else True),
|
|
291
291
|
volume_data.get("level", 1.0),
|
|
292
292
|
volume_data.get("muted", False),
|
|
@@ -121,7 +121,7 @@ class ZeroConfListener(zeroconf.ServiceListener):
|
|
|
121
121
|
_LOGGER.debug("remove_service %s, %s", type_, name)
|
|
122
122
|
cast_info = None
|
|
123
123
|
device_removed = False
|
|
124
|
-
uuid
|
|
124
|
+
uuid: UUID
|
|
125
125
|
service_info = MDNSServiceInfo(name)
|
|
126
126
|
# Lock because the HostBrowser may also add or remove items
|
|
127
127
|
with self._services_lock:
|
|
@@ -11,6 +11,10 @@ class ChromecastConnectionError(PyChromecastError):
|
|
|
11
11
|
"""When a connection error occurs within PyChromecast."""
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
class ChromecastConnectionClosed(PyChromecastError):
|
|
15
|
+
"""When a connection was closed by remote device."""
|
|
16
|
+
|
|
17
|
+
|
|
14
18
|
class PyChromecastStopped(PyChromecastError):
|
|
15
19
|
"""Raised when a command is invoked while the Chromecast's socket_client
|
|
16
20
|
is stopped.
|
|
@@ -33,6 +33,7 @@ from .controllers.receiver import CastStatus, CastStatusListener, ReceiverContro
|
|
|
33
33
|
from .dial import get_host_from_service
|
|
34
34
|
from .error import (
|
|
35
35
|
ChromecastConnectionError,
|
|
36
|
+
ChromecastConnectionClosed,
|
|
36
37
|
ControllerNotRegistered,
|
|
37
38
|
NotConnected,
|
|
38
39
|
PyChromecastStopped,
|
|
@@ -267,9 +268,7 @@ class SocketClient(threading.Thread, CastStatusListener):
|
|
|
267
268
|
retry["delay"] = min(retry["delay"] * 2, 300)
|
|
268
269
|
retries[service] = retry
|
|
269
270
|
|
|
270
|
-
while not self.stop.is_set() and (
|
|
271
|
-
tries is None or tries > 0
|
|
272
|
-
): # pylint:disable=too-many-nested-blocks
|
|
271
|
+
while not self.stop.is_set() and (tries is None or tries > 0):
|
|
273
272
|
# Prune retries dict
|
|
274
273
|
retries = {
|
|
275
274
|
key: retries[key]
|
|
@@ -619,6 +618,15 @@ class SocketClient(threading.Thread, CastStatusListener):
|
|
|
619
618
|
if self.stop.is_set():
|
|
620
619
|
return 1
|
|
621
620
|
raise
|
|
621
|
+
except ChromecastConnectionClosed as exc:
|
|
622
|
+
self._force_recon = True
|
|
623
|
+
self.logger.debug(
|
|
624
|
+
"[%s(%s):%s] %s",
|
|
625
|
+
self.fn or "",
|
|
626
|
+
self.host,
|
|
627
|
+
self.port,
|
|
628
|
+
exc,
|
|
629
|
+
)
|
|
622
630
|
except socket.error as exc:
|
|
623
631
|
self._force_recon = True
|
|
624
632
|
self.logger.error(
|
|
@@ -817,7 +825,7 @@ class SocketClient(threading.Thread, CastStatusListener):
|
|
|
817
825
|
try:
|
|
818
826
|
chunk = self.socket.recv(min(msglen - bytes_recd, 2048))
|
|
819
827
|
if chunk == b"":
|
|
820
|
-
raise
|
|
828
|
+
raise ChromecastConnectionClosed("Connection was closed by remote")
|
|
821
829
|
chunks.append(chunk)
|
|
822
830
|
bytes_recd += len(chunk)
|
|
823
831
|
except TimeoutError:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=65.6,<
|
|
2
|
+
requires = ["setuptools>=65.6,<83.0", "wheel>=0.37.1,<0.47.0"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "PyChromecast"
|
|
7
|
-
version = "14.0.
|
|
7
|
+
version = "14.0.10"
|
|
8
8
|
license = {text = "MIT"}
|
|
9
9
|
description = "Python module to talk to Google Chromecast."
|
|
10
10
|
readme = "README.rst"
|
|
@@ -30,8 +30,8 @@ classifiers=[
|
|
|
30
30
|
[project.urls]
|
|
31
31
|
"Homepage" = "https://github.com/home-assistant-libs/pychromecast"
|
|
32
32
|
|
|
33
|
-
[tool.
|
|
34
|
-
exclude = '
|
|
33
|
+
[tool.ruff]
|
|
34
|
+
exclude = ['*_pb2.*']
|
|
35
35
|
|
|
36
36
|
[tool.rstcheck]
|
|
37
37
|
# README.rst has embedded python examples which show the interactive interpreter output
|
|
@@ -48,3 +48,8 @@ include = ["pychromecast*"]
|
|
|
48
48
|
|
|
49
49
|
[tool.setuptools.package-data]
|
|
50
50
|
"*" = ["py.typed"]
|
|
51
|
+
|
|
52
|
+
[dependency-groups]
|
|
53
|
+
dev = [
|
|
54
|
+
"pre-commit>=4.5.0",
|
|
55
|
+
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pychromecast-14.0.9 → pychromecast-14.0.10}/pychromecast/controllers/homeassistant_media.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|