Updates the MediaPlayerEntity to handle the saving and loading logic.
The entity's internal volume state is now initialized from the saved preferences.volume_level.
When a volume change command is received from Home Assistant, the handle_message method now updates the Preferences object and calls save_preferences() to persist the new volume level to disk.
Modifies the startup sequence to read the volume_level from the loaded preferences.
This saved value is then passed as the initial_volume when creating the music_player and tts_player instances.
Updates the MpvMediaPlayer constructor (__init__) to accept an initial_volume parameter.
This allows the volume to be set immediately when the mpv process is created, applying the saved setting at startup.
Adds a new volume_level: float field to the Preferences dataclass. This creates a dedicated entry in the preferences.json file to store the user's desired volume (from 0.0 to 1.0).
Passes the event_bus and loop instances into the ServerState object upon creation.
Adds new command-line arguments (--led-interface, --led-clock-pin, --led-data-pin) to allow the user to select and configure the LED hardware interface at runtime.
event_bus: EventBus
loop: asyncio.AbstractEventLoop
This provides a globally accessible instance of the event bus and the main asyncio event loop to any component that needs them.