Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 8c59687

Browse files
fix/1.12.11 (#178)
1.12.11
1 parent 2d4f6bb commit 8c59687

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

custom_components/multimatic/config_flow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from homeassistant import config_entries, core, exceptions
99
from homeassistant.const import CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_USERNAME
1010
from homeassistant.core import callback
11-
from homeassistant.helpers.aiohttp_client import async_get_clientsession
11+
from homeassistant.helpers.aiohttp_client import async_create_clientsession
1212
import homeassistant.helpers.config_validation as cv
1313

1414
from .const import CONF_SERIAL_NUMBER, DEFAULT_SCAN_INTERVAL, DOMAIN
@@ -39,7 +39,7 @@ async def validate_authentication(hass, username, password):
3939
"""Ensure provided credentials are working."""
4040
try:
4141
if not await SystemManager(
42-
username, password, async_get_clientsession(hass)
42+
username, password, async_create_clientsession(hass)
4343
).login(True):
4444
raise InvalidAuth
4545
except ApiError as err:

custom_components/multimatic/coordinator.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
from homeassistant.config_entries import ConfigEntry
2828
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
29-
from homeassistant.helpers.aiohttp_client import async_get_clientsession
29+
from homeassistant.helpers.aiohttp_client import async_create_clientsession
3030
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
3131

3232
from .const import (
@@ -61,7 +61,7 @@ def __init__(self, hass, entry: ConfigEntry):
6161
self._manager = pymultimatic.systemmanager.SystemManager(
6262
user=username,
6363
password=password,
64-
session=async_get_clientsession(hass),
64+
session=async_create_clientsession(hass),
6565
serial=self.serial,
6666
)
6767

@@ -528,8 +528,9 @@ async def _fetch_data(self):
528528
try:
529529
self.logger.debug("calling %s", self._method)
530530
return await getattr(self.api, self._method)()
531-
except ApiError:
532-
await self._safe_logout()
531+
except ApiError as err:
532+
if err.status == 401:
533+
await self._safe_logout()
533534
raise
534535

535536
async def _fetch_data_if_needed(self):

custom_components/multimatic/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"homekit": {},
1313
"dependencies": [],
1414
"codeowners": ["@thomasgermain"],
15-
"version": "1.12.10",
15+
"version": "1.12.11",
1616
"iot_class": "cloud_polling"
1717
}

custom_components/multimatic/strings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"already_configured": "Only one configuration is allowed"
2121
}
2222
},
23-
"options": {
23+
"options": {
2424
"step": {
2525
"init": {
2626
"data": {
@@ -29,4 +29,4 @@
2929
}
3030
}
3131
}
32-
}
32+
}

custom_components/multimatic/translations/de.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"application": "Applikation",
99
"serial_number": "Seriennummer"
1010
},
11-
"title": "Verbindungsinformationen (wie in der mutliMATIC / sensoAPP"
11+
"title": "Verbindungsinformationen (wie in der mutliMATIC / sensoAPP)"
1212
}
1313
},
1414
"error": {

0 commit comments

Comments
 (0)