* Entity registry support for monoprice * Add test for unique_id * Add unique id namespace to monoprice * Config Flow for Monoprice * Update monoprice tests * Remove TODOs * Handle entity unloading * Fix update test * Streamline entity handling in monoprice services * Increase coverage * Remove devices cache * Async validation in monoprice config flow
37 lines
981 B
Python
37 lines
981 B
Python
"""The Monoprice 6-Zone Amplifier integration."""
|
|
import asyncio
|
|
|
|
from homeassistant.config_entries import ConfigEntry
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
PLATFORMS = ["media_player"]
|
|
|
|
|
|
async def async_setup(hass: HomeAssistant, config: dict):
|
|
"""Set up the Monoprice 6-Zone Amplifier component."""
|
|
return True
|
|
|
|
|
|
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
|
"""Set up Monoprice 6-Zone Amplifier from a config entry."""
|
|
for component in PLATFORMS:
|
|
hass.async_create_task(
|
|
hass.config_entries.async_forward_entry_setup(entry, component)
|
|
)
|
|
|
|
return True
|
|
|
|
|
|
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):
|
|
"""Unload a config entry."""
|
|
unload_ok = all(
|
|
await asyncio.gather(
|
|
*[
|
|
hass.config_entries.async_forward_entry_unload(entry, component)
|
|
for component in PLATFORMS
|
|
]
|
|
)
|
|
)
|
|
|
|
return unload_ok
|