From 898d2b33aaeb4c508c6ce4e774f4ba4f27b45419 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 16 Feb 2025 23:25:26 +0000 Subject: [PATCH 1/2] Chore(deps): Bump mypy from 1.13.0 to 1.15.0 Bumps [mypy](https://github.com/python/mypy) from 1.13.0 to 1.15.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.13.0...v1.15.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 56603c76a..b041a3779 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ version = "0.0.0" test = [ "codespell==2.3.0", "isort==6.0.0", - "mypy==1.13.0", + "mypy==1.15.0", "pre-commit==4.1.0", "pre-commit-hooks==5.0.0", "pytest==8.3.4", From 174be24aae4fe7f82b45c853dad80d3e3cde19ca Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Mon, 17 Feb 2025 21:33:45 +0100 Subject: [PATCH 2/2] lint --- music_assistant/providers/hass/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/music_assistant/providers/hass/__init__.py b/music_assistant/providers/hass/__init__.py index eb34f5ec3..c3c0a2662 100644 --- a/music_assistant/providers/hass/__init__.py +++ b/music_assistant/providers/hass/__init__.py @@ -388,14 +388,18 @@ async def _register_player_controls(self) -> None: control.power_off = partial(self._handle_player_control_power_off, entity_id) if entity_id in volume_controls: control.supports_volume = True - if entity_platform == "media_player": + if not hass_state: + control.volume_level = 0 + elif entity_platform == "media_player": control.volume_level = hass_state["attributes"].get("volume_level", 0) * 100 else: control.volume_level = try_parse_int(hass_state["state"]) or 0 control.volume_set = partial(self._handle_player_control_volume_set, entity_id) if entity_id in mute_controls: control.supports_mute = True - if entity_platform == "media_player": + if not hass_state: + control.volume_muted = False + elif entity_platform == "media_player": control.volume_muted = hass_state["attributes"].get("volume_muted") elif hass_state: control.volume_muted = hass_state["state"] not in OFF_STATES