Chore(deps): Bump mypy from 1.13.0 to 1.15.0 (#1953)
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Mon, 17 Feb 2025 20:39:13 +0000 (21:39 +0100)
committerGitHub <noreply@github.com>
Mon, 17 Feb 2025 20:39:13 +0000 (21:39 +0100)
* 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] <support@github.com>
* lint

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
music_assistant/providers/hass/__init__.py
pyproject.toml

index eb34f5ec3358a4ec644231c1dbd56e04b64f7994..c3c0a266216652098d9e2bf6df35452acd1515bd 100644 (file)
@@ -388,14 +388,18 @@ class HomeAssistantProvider(PluginProvider):
                 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
index 495b964970384ed9d6192a35fecfe803b25113a7..8b18e077a8eb5679c4f7224a40e3e9f2c5121394 100644 (file)
@@ -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",