1 """SlimProto Player integration."""
3 from __future__
import annotations
5 from aioslimproto
import SlimServer
12 from .const
import DOMAIN
14 PLATFORMS = [Platform.MEDIA_PLAYER]
18 """Set up from a config entry."""
19 slimserver = SlimServer()
20 await slimserver.start()
22 hass.data[DOMAIN] = slimserver
25 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
28 async
def on_hass_stop(event: Event) ->
None:
29 """Handle incoming stop event from Home Assistant."""
30 await slimserver.stop()
32 entry.async_on_unload(
33 hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, on_hass_stop)
40 hass: HomeAssistant, config_entry: ConfigEntry, device_entry: dr.DeviceEntry
42 """Remove a config entry from a device."""
47 """Unload a config entry."""
48 unload_success = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
50 await hass.data.pop(DOMAIN).stop()
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)
bool async_remove_config_entry_device(HomeAssistant hass, ConfigEntry config_entry, dr.DeviceEntry device_entry)
bool async_setup_entry(HomeAssistant hass, ConfigEntry entry)