-
-
Notifications
You must be signed in to change notification settings - Fork 367
Add Wiim provider based on pywiim #3067
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
43
commits into
music-assistant:dev
Choose a base branch
from
davidanthoff:da/pywiim
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
Changes from 41 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
cde7474
Add Wiim provider
davidanthoff 6ccc16b
Small fixes for Wiim provider
davidanthoff 786c9a2
Cleanup Wiim codebase
davidanthoff 098e0be
Simplify Wiim code
davidanthoff 3d6ceeb
Implement device discovery for Wiim provider
davidanthoff 78ea62c
Reduce logging for Wiim provider
davidanthoff 2463617
Add more features to Wiim provider
davidanthoff b7987b9
Merge branch 'dev' into da/pywiim
davidanthoff 49b4ac8
Handle sources better for the Wiim provider
davidanthoff 1dae323
Add beta stage to Wiim provider
davidanthoff 1bc3342
Unload things properly for Wiim provider
davidanthoff b9728b8
Refactor a small part of the Wiim provider
davidanthoff 8f8b922
Update pywiim version
davidanthoff 50b2cd3
Fix source handling in Wiim provider
davidanthoff a3d885b
Update Wiim logo
davidanthoff 4c46cab
Merge branch 'dev' into da/pywiim
davidanthoff e36f63b
Merge branch 'dev' into da/pywiim
MarvinSchenkel a9d65ef
Fix white space stripping for Wiim provider
davidanthoff 32a4d2d
Merge branch 'da/pywiim' of https://github.com/davidanthoff/server in…
davidanthoff 697ed6a
Address feedback on Wiim provider
davidanthoff a48a581
Remove old file from Wiim provider
davidanthoff 5c5c52e
Pin async-upnp-client for Wiim provider
davidanthoff 2f97f0c
Various progress on Wiim provider
davidanthoff a1e579e
Change a log level in the Wiim provider
davidanthoff d97dded
Update Wiim icon
davidanthoff 7ad4036
Update pywiim and set manufacturer field
davidanthoff bd79980
Merge branch 'dev' into da/pywiim
davidanthoff 86fef77
Move player disocvery to new function for Wiim provider
davidanthoff 0e559eb
Handle discovery errors better in Wiim provider
davidanthoff 4d9eba3
Merge branch 'dev' into da/pywiim
davidanthoff 6f8a014
Deduplicate manual ip addresses for Wiim provider
davidanthoff 87cd16b
Skip disabled player in discovery in Wiim provider
davidanthoff 7dbcb2b
Add master to beginning of group for Wiim provider
davidanthoff d985d4e
Mention Linkplay in Wiim provider description
davidanthoff 0ce3529
Make resource cleanup more robust in Wiim provider
davidanthoff 0900ed8
Merge branch 'dev' into da/pywiim
davidanthoff 6c90989
Fix string interpolation in Wiim provider
davidanthoff eee7b7c
Merge branch 'da/pywiim' of https://github.com/davidanthoff/server in…
davidanthoff 889c1d0
Fix a None situation in Wiim provider
davidanthoff a7e8ade
Simplify code in Wiim player
davidanthoff 2eb40b6
Merge branch 'dev' into da/pywiim
MarvinSchenkel 66d1a56
Update pywiim dep for Wiim provider
davidanthoff ebc8392
Use better model name for Wiim provider
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,) |
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", | ||
| "stage": "beta", | ||
| "description": "Stream music to WiiM and LinkPlay devices.", | ||
| "codeowners": ["@davidanthoff"], | ||
| "requirements": ["pywiim==2.1.84", "async-upnp-client==0.46.2"], | ||
|
||
| "documentation": "https://music-assistant.io/player-support/wiim/" | ||
| } | ||
Oops, something went wrong.
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.
Seems the lint is failing on this file. Could you add a blank line?