Bump linkplay to v0.2.0 (#141098)

* Bump linkplay to v0.2.0

* Fix invalid reference on items()

* Ruff
This commit is contained in:
Simon Lamon 2025-03-23 15:27:40 +01:00 committed by GitHub
parent 56f553e352
commit 5f3344cd3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 13 deletions

View File

@ -7,6 +7,6 @@
"integration_type": "hub", "integration_type": "hub",
"iot_class": "local_polling", "iot_class": "local_polling",
"loggers": ["linkplay"], "loggers": ["linkplay"],
"requirements": ["python-linkplay==0.1.3"], "requirements": ["python-linkplay==0.2.0"],
"zeroconf": ["_linkplay._tcp.local."] "zeroconf": ["_linkplay._tcp.local."]
} }

View File

@ -86,16 +86,10 @@ REPEAT_MAP: dict[LoopMode, RepeatMode] = {
REPEAT_MAP_INV: dict[RepeatMode, LoopMode] = {v: k for k, v in REPEAT_MAP.items()} REPEAT_MAP_INV: dict[RepeatMode, LoopMode] = {v: k for k, v in REPEAT_MAP.items()}
EQUALIZER_MAP: dict[EqualizerMode, str] = { EQUALIZER_MAP_INV: dict[str, EqualizerMode] = {
EqualizerMode.NONE: "None", mode.value: mode for mode in EqualizerMode
EqualizerMode.CLASSIC: "Classic",
EqualizerMode.POP: "Pop",
EqualizerMode.JAZZ: "Jazz",
EqualizerMode.VOCAL: "Vocal",
} }
EQUALIZER_MAP_INV: dict[str, EqualizerMode] = {v: k for k, v in EQUALIZER_MAP.items()}
DEFAULT_FEATURES: MediaPlayerEntityFeature = ( DEFAULT_FEATURES: MediaPlayerEntityFeature = (
MediaPlayerEntityFeature.PLAY MediaPlayerEntityFeature.PLAY
| MediaPlayerEntityFeature.PLAY_MEDIA | MediaPlayerEntityFeature.PLAY_MEDIA
@ -148,7 +142,6 @@ async def async_setup_entry(
class LinkPlayMediaPlayerEntity(LinkPlayBaseEntity, MediaPlayerEntity): class LinkPlayMediaPlayerEntity(LinkPlayBaseEntity, MediaPlayerEntity):
"""Representation of a LinkPlay media player.""" """Representation of a LinkPlay media player."""
_attr_sound_mode_list = list(EQUALIZER_MAP.values())
_attr_device_class = MediaPlayerDeviceClass.RECEIVER _attr_device_class = MediaPlayerDeviceClass.RECEIVER
_attr_media_content_type = MediaType.MUSIC _attr_media_content_type = MediaType.MUSIC
_attr_name = None _attr_name = None
@ -163,6 +156,9 @@ class LinkPlayMediaPlayerEntity(LinkPlayBaseEntity, MediaPlayerEntity):
self._attr_source_list = [ self._attr_source_list = [
SOURCE_MAP[playing_mode] for playing_mode in bridge.device.playmode_support SOURCE_MAP[playing_mode] for playing_mode in bridge.device.playmode_support
] ]
self._attr_sound_mode_list = [
mode.value for mode in bridge.player.available_equalizer_modes
]
@exception_wrap @exception_wrap
async def async_update(self) -> None: async def async_update(self) -> None:
@ -348,7 +344,7 @@ class LinkPlayMediaPlayerEntity(LinkPlayBaseEntity, MediaPlayerEntity):
self._attr_is_volume_muted = self._bridge.player.muted self._attr_is_volume_muted = self._bridge.player.muted
self._attr_repeat = REPEAT_MAP[self._bridge.player.loop_mode] self._attr_repeat = REPEAT_MAP[self._bridge.player.loop_mode]
self._attr_shuffle = self._bridge.player.loop_mode == LoopMode.RANDOM_PLAYBACK self._attr_shuffle = self._bridge.player.loop_mode == LoopMode.RANDOM_PLAYBACK
self._attr_sound_mode = EQUALIZER_MAP[self._bridge.player.equalizer_mode] self._attr_sound_mode = self._bridge.player.equalizer_mode.value
self._attr_supported_features = DEFAULT_FEATURES self._attr_supported_features = DEFAULT_FEATURES
if self._bridge.player.status == PlayingStatus.PLAYING: if self._bridge.player.status == PlayingStatus.PLAYING:

2
requirements_all.txt generated
View File

@ -2425,7 +2425,7 @@ python-juicenet==1.1.0
python-kasa[speedups]==0.10.2 python-kasa[speedups]==0.10.2
# homeassistant.components.linkplay # homeassistant.components.linkplay
python-linkplay==0.1.3 python-linkplay==0.2.0
# homeassistant.components.lirc # homeassistant.components.lirc
# python-lirc==1.2.3 # python-lirc==1.2.3

View File

@ -1961,7 +1961,7 @@ python-juicenet==1.1.0
python-kasa[speedups]==0.10.2 python-kasa[speedups]==0.10.2
# homeassistant.components.linkplay # homeassistant.components.linkplay
python-linkplay==0.1.3 python-linkplay==0.2.0
# homeassistant.components.matter # homeassistant.components.matter
python-matter-server==7.0.0 python-matter-server==7.0.0