* initial stab at snapcast config flow * fix linting errors * Fix linter errors * Add import flow, support unloading * Add test for import flow * Add dataclass and remove unique ID in config-flow * remove translations * Apply suggestions from code review Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> * Refactor config flow and terminate connection * Rename test_config_flow.py * Fix tests * Minor fixes * Make mock_create_server a fixture * Combine tests * Abort if entry already exists * Apply suggestions from code review Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> * Move HomeAssistantSnapcast to own file. Clean-up last commit * Split import flow from user flow. Fix tests. * Use explicit asserts. Add default values to dataclass * Change entry title to Snapcast --------- Co-authored-by: Barrett Lowe <barrett.lowe@gmail.com> Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
15 lines
444 B
Python
15 lines
444 B
Python
"""Snapcast Integration."""
|
|
from dataclasses import dataclass, field
|
|
|
|
from snapcast.control import Snapserver
|
|
|
|
from homeassistant.components.media_player import MediaPlayerEntity
|
|
|
|
|
|
@dataclass
|
|
class HomeAssistantSnapcast:
|
|
"""Snapcast data stored in the Home Assistant data object."""
|
|
|
|
server: Snapserver
|
|
clients: list[MediaPlayerEntity] = field(default_factory=list)
|
|
groups: list[MediaPlayerEntity] = field(default_factory=list)
|