Skip to content

Commit

Permalink
Fix flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Mamontov committed Dec 18, 2021
1 parent 9c06a1b commit a8abfbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions custom_components/miwifi/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
CONF_SCAN_INTERVAL,
CONF_TIMEOUT
)
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.httpx_client import get_async_client

from .core.const import (
DOMAIN,
Expand Down Expand Up @@ -45,9 +45,7 @@ async def async_step_auth(self, user_input):
if user_input is None:
return self.cur_step

session = async_get_clientsession(self.hass, False)

client = Luci(self.hass, session, user_input[CONF_IP_ADDRESS], user_input[CONF_PASSWORD])
client = Luci(self.hass, get_async_client(self.hass, False), user_input[CONF_IP_ADDRESS], user_input[CONF_PASSWORD])

try:
await client.login()
Expand Down Expand Up @@ -109,9 +107,7 @@ async def async_step_settings(self, user_input = None):
})

if user_input:
session = async_get_clientsession(self.hass, False)

client = Luci(self.hass, session, user_input[CONF_IP_ADDRESS], user_input[CONF_PASSWORD])
client = Luci(self.hass, get_async_client(self.hass, False), user_input[CONF_IP_ADDRESS], user_input[CONF_PASSWORD])

try:
await client.login()
Expand Down
2 changes: 1 addition & 1 deletion custom_components/miwifi/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "miwifi",
"name": "MiWiFi",
"version": "1.3.0",
"version": "1.3.1",
"documentation": "https://github.com/dmamontov/hass-miwifi",
"issue_tracker": "https://github.com/dmamontov/hass-miwifi/issues",
"config_flow": true,
Expand Down

0 comments on commit a8abfbd

Please sign in to comment.