mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00:00
Use new ServiceInfo location in wmspro (#135702)
* Use new ServiceInfo location in wmspro * Fix self.source
This commit is contained in:
parent
51e3bf42f2
commit
be06ef46c1
@ -10,8 +10,7 @@ import aiohttp
|
||||
import voluptuous as vol
|
||||
from wmspro.webcontrol import WebControlPro
|
||||
|
||||
from homeassistant.components import dhcp
|
||||
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
|
||||
from homeassistant.config_entries import SOURCE_DHCP, ConfigFlow, ConfigFlowResult
|
||||
from homeassistant.const import CONF_HOST
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.helpers.device_registry import format_mac
|
||||
@ -34,7 +33,7 @@ class WebControlProConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
VERSION = 1
|
||||
|
||||
async def async_step_dhcp(
|
||||
self, discovery_info: dhcp.DhcpServiceInfo
|
||||
self, discovery_info: DhcpServiceInfo
|
||||
) -> ConfigFlowResult:
|
||||
"""Handle the DHCP discovery step."""
|
||||
unique_id = format_mac(discovery_info.macaddress)
|
||||
@ -95,7 +94,7 @@ class WebControlProConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
return self.async_abort(reason="already_configured")
|
||||
return self.async_create_entry(title=host, data=user_input)
|
||||
|
||||
if self.source == dhcp.DOMAIN:
|
||||
if self.source == SOURCE_DHCP:
|
||||
discovery_info: DhcpServiceInfo = self.init_data
|
||||
data_values = {CONF_HOST: discovery_info.ip}
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user