"""All constants for Music Assistant."""
-__version__ = "0.1.8"
+__version__ = "0.1.9"
REQUIRED_PYTHON_VER = "3.8"
# configuration keys/attributes
LOGGER = logging.getLogger("AsyncProcess")
DEFAULT_CHUNKSIZE = 512000
-DEFAULT_TIMEOUT = 5
+DEFAULT_TIMEOUT = 60
class AsyncProcess:
return await self._proc.stdout.readexactly(chunk_size)
except asyncio.IncompleteReadError as err:
return err.partial
+ except AttributeError:
+ raise asyncio.CancelledError()
async def write(self, data: bytes) -> None:
"""Write data to process stdin."""
await self._proc.stdin.drain()
except BrokenPipeError:
pass
+ except AttributeError:
+ raise asyncio.CancelledError()
async def write_eof(self) -> None:
"""Write eof to process."""
ConfigEntry(
entry_key=CONF_TARGET_VOLUME,
entry_type=ConfigEntryType.INT,
- range=(-30, 0),
+ range=(-40, 0),
default_value=-23,
label=CONF_TARGET_VOLUME,
description="desc_target_volume",
or self.media_status.player_is_idle
)
# Chromecast does not support power so we (ab)use mute instead
- return not self.cast_status.volume_muted
+ return (
+ not self.cast_status.display_name
+ or self.cast_status.display_name == "Default Media Receiver"
+ ) and not self.cast_status.volume_muted
@property
def should_poll(self) -> bool:
@property
def state(self) -> PlaybackState:
"""Return the state of the player."""
+ if not self.powered:
+ return PlaybackState.Off
if self.media_status is None:
return PlaybackState.Stopped
if self.media_status.player_is_playing: