# Path: custom_components/senseme/const.py
# CONF_HOST_MANUAL = "IP Address"
# 
# CONF_INFO = "info"
# 
# DOMAIN = "senseme"


import ipaddress
import voluptuous as vol
from aiosenseme import async_get_device_by_ip_address, discover_all
from homeassistant import config_entries
from homeassistant.const import CONF_HOST
from .const import CONF_HOST_MANUAL, CONF_INFO, DOMAIN
"""Config flow for SenseME."""



DISCOVER_TIMEOUT = 5


class SensemeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
    """Handle SenseME discovery config flow."""

    VERSION = 1
    CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_PUSH

    def __init__(self) -> None:
        """Initialize the SenseME config flow."""
        self._discovered_devices = None

    async def _async_entry_for_device(self, device):
        """Create a config entry for a device."""
        await self.async_set_unique_id(device.uuid)
        self._abort_if_unique_id_configured()
        return self.async_create_entry(
            title=device.name,

# Path: custom_components/senseme/const.py
# CONF_HOST_MANUAL = "IP Address"
# 
# CONF_INFO = "info"
# 
# DOMAIN = "senseme"


# Path: custom_components/senseme/config_flow.py
import ipaddress
import voluptuous as vol
from aiosenseme import async_get_device_by_ip_address, discover_all
from homeassistant import config_entries
from homeassistant.const import CONF_HOST
from .const import CONF_HOST_MANUAL, CONF_INFO, DOMAIN

"""Config flow for SenseME."""



DISCOVER_TIMEOUT = 5


class SensemeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
    """Handle SenseME discovery config flow."""

    VERSION = 1
    CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_PUSH

    def __init__(self) -> None:
        """Initialize the SenseME config flow."""
        self._discovered_devices = None

    async def _async_entry_for_device(self, device):
        """Create a config entry for a device."""
        await self.async_set_unique_id(device.uuid)
        self._abort_if_unique_id_configured()
        return self.async_create_entry(
            title=device.name,

            data={CONF_INFO: device.get_device_info},