Cleanup implementation of new Sonos sensors (#49716)
This commit is contained in:
parent
9e7d83b2d5
commit
dc50524f32
6 changed files with 35 additions and 47 deletions
|
@ -2,14 +2,16 @@
|
|||
import pysonos
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import config_entry_flow
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
|
||||
async def _async_has_devices(hass):
|
||||
async def _async_has_devices(hass: HomeAssistant) -> bool:
|
||||
"""Return if there are devices that can be discovered."""
|
||||
return await hass.async_add_executor_job(pysonos.discover)
|
||||
result = await hass.async_add_executor_job(pysonos.discover)
|
||||
return bool(result)
|
||||
|
||||
|
||||
config_entry_flow.register_discovery_flow(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue