Fixed bug where if pychromecast is not imported, type annotations break things
This commit is contained in:
@@ -5,7 +5,7 @@ import multiprocessing
|
|||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from typing import Callable, Dict, Optional, Set, Tuple, Type, Union
|
from typing import Any, Callable, Dict, Optional, Set, Tuple, Type, Union
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ class ChromecastPlayer(Player):
|
|||||||
self._current_chromecast.register_status_listener(self)
|
self._current_chromecast.register_status_listener(self)
|
||||||
self._current_chromecast.wait()
|
self._current_chromecast.wait()
|
||||||
|
|
||||||
def new_cast_status(self, status: pychromecast.socket_client.CastStatus):
|
def new_cast_status(self, status: Any):
|
||||||
self.on_player_event(
|
self.on_player_event(
|
||||||
PlayerEvent(
|
PlayerEvent(
|
||||||
PlayerEvent.EventType.VOLUME_CHANGE,
|
PlayerEvent.EventType.VOLUME_CHANGE,
|
||||||
@@ -121,9 +121,7 @@ class ChromecastPlayer(Player):
|
|||||||
|
|
||||||
time_increment_order_token = 0
|
time_increment_order_token = 0
|
||||||
|
|
||||||
def new_media_status(
|
def new_media_status(self, status: Any):
|
||||||
self, status: pychromecast.controllers.media.MediaStatus,
|
|
||||||
):
|
|
||||||
# Detect the end of a track and go to the next one.
|
# Detect the end of a track and go to the next one.
|
||||||
if (
|
if (
|
||||||
status.idle_reason == "FINISHED"
|
status.idle_reason == "FINISHED"
|
||||||
|
Reference in New Issue
Block a user