Add Refoss integration (#100573)
* refoss * refoss * refoss * refoss * refoss modify * ip * 8.22 * format * format * format * bugfix * test * test * test * test * test * test * 9.1 * refosss * refoss * refoss * refoss * refoss * refoss * refoss * refoss * test * requirements_test_all.txt * codeowners * refoss * Review feedback repair * strings * refoss * refoss * refoss * 1.1.1 * 1.1.2 * refoss * refoss * refoss.1.1.7 * refoss-gree * 1.1.7 * test * refoss * test refoss * test refoss * refoss-test * refoss * refoss * test * test * refoss * CODEOWNERS * fix * Update homeassistant/components/refoss/__init__.py --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
parent
f536bc1d0c
commit
102c7f1959
19 changed files with 524 additions and 0 deletions
20
homeassistant/components/refoss/config_flow.py
Normal file
20
homeassistant/components/refoss/config_flow.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
"""Config Flow for Refoss integration."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import config_entry_flow
|
||||
|
||||
from .const import DISCOVERY_TIMEOUT, DOMAIN
|
||||
from .util import refoss_discovery_server
|
||||
|
||||
|
||||
async def _async_has_devices(hass: HomeAssistant) -> bool:
|
||||
"""Return if there are devices that can be discovered."""
|
||||
|
||||
refoss_discovery = await refoss_discovery_server(hass)
|
||||
devices = await refoss_discovery.broadcast_msg(wait_for=DISCOVERY_TIMEOUT)
|
||||
return len(devices) > 0
|
||||
|
||||
|
||||
config_entry_flow.register_discovery_flow(DOMAIN, "Refoss", _async_has_devices)
|
Loading…
Add table
Add a link
Reference in a new issue