-
-
Notifications
You must be signed in to change notification settings - Fork 367
WiiM provider #2947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
davidanthoff
wants to merge
26
commits into
music-assistant:dev
Choose a base branch
from
davidanthoff:da/wiim
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
WiiM provider #2947
Changes from 17 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
24cc7d1
Add WiiM provider
davidanthoff 9ce0bbd
Merge branch 'dev' into da/wiim
davidanthoff c32db10
Fix a naming error in the WiiM provider
davidanthoff c06afbf
Update state more often for the WiiM player
davidanthoff 97b397c
Store deps for WiiM provider in manifest.json
davidanthoff 366f64b
Remove hard coded IP address in WiiM provider
davidanthoff 2fe0211
Progress on the WiiM provider
davidanthoff 7e1ae81
Improve WiiM device detection a bit
davidanthoff c1a4f34
Refactor WiiM provider a bit
davidanthoff 7c9806e
Remove unneeded things from WiiM provider
davidanthoff 5d4523b
Add play queue callback to WiiM provider
davidanthoff 83ccbb9
Pass media meta info to WiiM player
davidanthoff 9abf553
Propagate WiiM device media info to MA
davidanthoff 2058a2a
Add source support to Wiim provider
davidanthoff 4729ba0
Merge branch 'dev' into da/wiim
davidanthoff ac9fff9
Fix Wiim provider source handling
davidanthoff 635ef36
Pin wiim depencendy for Wiim provider to custom branch
davidanthoff 652da93
Update music_assistant/providers/wiim/manifest.json
davidanthoff da5d317
Use self.logger for Wiim provider
davidanthoff 21ced87
Use didl feature from MA in Wiim provider
davidanthoff 0677651
Update music_assistant/providers/wiim/provider.py
davidanthoff caf6787
Update music_assistant/providers/wiim/provider.py
davidanthoff 35a7e3c
Adjust log levels for Wiim provider
davidanthoff e0857a0
Merge branch 'da/wiim' of https://github.com/davidanthoff/server into…
davidanthoff d6422f9
Set more media attributes in Wiim provider
davidanthoff 0aabea9
Merge branch 'dev' into da/wiim
davidanthoff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| """ | ||
| Provider for WiiM speakers. | ||
|
|
||
| This package provides a Music Assistant provider implementation for WiiM speakers. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from typing import TYPE_CHECKING | ||
|
|
||
| from music_assistant_models.enums import ProviderFeature | ||
|
|
||
| from music_assistant.constants import CONF_ENTRY_MANUAL_DISCOVERY_IPS | ||
|
|
||
| from .provider import WiimProvider | ||
|
|
||
| if TYPE_CHECKING: | ||
| from music_assistant_models.config_entries import ConfigEntry, ConfigValueType, ProviderConfig | ||
| from music_assistant_models.provider import ProviderManifest | ||
|
|
||
| from music_assistant.mass import MusicAssistant | ||
| from music_assistant.models import ProviderInstanceType | ||
|
|
||
| SUPPORTED_FEATURES = { | ||
| ProviderFeature.SYNC_PLAYERS, | ||
| } | ||
|
|
||
|
|
||
| async def setup( | ||
| mass: MusicAssistant, manifest: ProviderManifest, config: ProviderConfig | ||
| ) -> ProviderInstanceType: | ||
| """Initialize provider(instance) with given configuration.""" | ||
| return WiimProvider(mass, manifest, config, SUPPORTED_FEATURES) | ||
|
|
||
|
|
||
| async def get_config_entries( | ||
| mass: MusicAssistant, # noqa: ARG001 | ||
| instance_id: str | None = None, # noqa: ARG001 | ||
| action: str | None = None, # noqa: ARG001 | ||
| values: dict[str, ConfigValueType] | None = None, # noqa: ARG001 | ||
| ) -> tuple[ConfigEntry, ...]: | ||
| """ | ||
| Return Config entries to setup this provider. | ||
|
|
||
| instance_id: id of an existing provider instance (None if new instance setup). | ||
| action: [optional] action key called from config entries UI. | ||
| values: the (intermediate) raw values for config entries sent with the action. | ||
| """ | ||
| return (CONF_ENTRY_MANUAL_DISCOVERY_IPS,) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| """Constants for the WiiM Provider.""" | ||
|
|
||
| from music_assistant_models.player import PlayerSource | ||
|
|
||
| SOURCE_LINE_IN = "line_in" | ||
| SOURCE_AIRPLAY = "airplay" | ||
| SOURCE_SPOTIFY = "spotify" | ||
| SOURCE_UNKNOWN = "unknown" | ||
| SOURCE_TV = "tv" | ||
| SOURCE_RADIO = "radio" | ||
|
|
||
| PLAYER_SOURCE_MAP = { | ||
| SOURCE_LINE_IN: PlayerSource( | ||
| id=SOURCE_LINE_IN, | ||
| name="Line-in", | ||
| passive=False, | ||
| can_play_pause=False, | ||
| can_next_previous=False, | ||
| can_seek=False, | ||
| ), | ||
| SOURCE_TV: PlayerSource( | ||
| id=SOURCE_TV, | ||
| name="TV", | ||
| passive=False, | ||
| can_play_pause=False, | ||
| can_next_previous=False, | ||
| can_seek=False, | ||
| ), | ||
| SOURCE_AIRPLAY: PlayerSource( | ||
| id=SOURCE_AIRPLAY, | ||
| name="AirPlay", | ||
| passive=True, | ||
| can_play_pause=True, | ||
| can_next_previous=True, | ||
| can_seek=True, | ||
| ), | ||
| SOURCE_SPOTIFY: PlayerSource( | ||
| id=SOURCE_SPOTIFY, | ||
| name="Spotify", | ||
| passive=True, | ||
| can_play_pause=True, | ||
| can_next_previous=True, | ||
| can_seek=True, | ||
| ), | ||
| SOURCE_RADIO: PlayerSource( | ||
| id=SOURCE_RADIO, | ||
| name="Radio", | ||
| passive=True, | ||
| can_play_pause=True, | ||
| can_next_previous=True, | ||
| can_seek=True, | ||
| ), | ||
| SOURCE_UNKNOWN: PlayerSource( | ||
| id=SOURCE_UNKNOWN, | ||
| name="Unknown", | ||
| passive=True, | ||
| can_play_pause=True, | ||
| can_next_previous=True, | ||
| can_seek=True, | ||
| ), | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "type": "player", | ||
| "domain": "wiim", | ||
| "name": "WiiM", | ||
| "description": "Stream music to WiiM devices.", | ||
| "codeowners": ["@davidanthoff"], | ||
| "requirements": ["wiim@git+https://github.com/davidanthoff/wiim.git@ma-branch", "python-didl-lite==1.5.0"], | ||
| "documentation": "https://music-assistant.io/player-support/demo/", | ||
davidanthoff marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "mdns_discovery": ["_linkplay._tcp.local."] | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.