lolcatt.casting package

Submodules

lolcatt.casting.caster module

class lolcatt.casting.caster.CastState(cast_info, info, is_loading=False, loading_failed=False, queue_len=0)[source]

Bases: object

Dataclass for cast state, encapsulating info dictionaries of a catt controller.

cast_info: dict
info: dict
is_loading: bool = False
loading_failed: bool = False
queue_len: int = 0
class lolcatt.casting.caster.Caster(name_or_alias='default', update_interval=0.5, autoplay=True, config=None)[source]

Bases: object

Class encapsulating the catt.api.CattDevice.

Provides a simple interface and enables exchange of the CattDevice on the fly.

CAST_ARGS = ['--force-default']
CATT_ARGS = []
cast(url_or_path)[source]

Casts the given url or path to the currently active device.

Parameters:

url_or_path (str) – The url or path to cast.

cast_at_idx(idx)[source]

Skips to the item at the given index in the queues.

cast_next()[source]

Casts the next item in the queue to the currently active device.

cast_previous()[source]

Casts the previous item in the queue to the currently active device.

change_device(name_or_alias=None)[source]

Changes the currently active device to the given name or alias. If the device is not available, a ValueError is raised.

Parameters:

name_or_alias (Optional[str]) – The name or alias of the device to change to.

clear_queue()[source]

Clears the queue.

enqueue(url_or_path, front=False)[source]

Enqueues the given url or path to the queue.

Parameters:
  • url_or_path (str) – The url or path to enqueue.

  • front (bool) – If True, the url or path is added to the front of the queue.

get_available_devices()[source]

Runs Chromecast discovery and returns a list of available CattDevices.

Return type:

List[CattDevice]

Returns:

A list of available CattDevices.

get_cast_state()[source]

Returns a CastState object encapsulating the info dictionaries of the currently active CattDevice.

Return type:

CastState

Returns:

A CastState object

get_current_item()[source]

Returns the currently playing item.

Return type:

Optional[str]

Returns:

The currently playing item.

get_device()[source]

Returns the currently active CattDevice.

Return type:

Optional[CattDevice]

Returns:

The currently active CattDevice.

get_device_name()[source]

Returns the name of the currently active CattDevice.

Return type:

Optional[str]

Returns:

The name of the currently active CattDevice.

get_played_queue()[source]

Returns the played queue.

Return type:

List[str]

Returns:

The played queue.

get_queue()[source]

Returns the current queue.

Return type:

List[str]

Returns:

The current queue.

get_update_interval()[source]

Returns the update interval of the CastState. Determines how often UI elements are need to be updated.

Return type:

float

Returns:

The update interval of the CastState.

get_well_known_devices()[source]

Returns well known devices which have aliases set.

Return type:

Dict[str, CattDevice]

Returns:

Well known devices.

stop_cast()[source]

Stops the current cast.

Module contents