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

Commit

Permalink
fix/1.12.11 (#178)
Browse files Browse the repository at this point in the history
1.12.11
  • Loading branch information
thomasgermain authored Dec 31, 2022
1 parent 2d4f6bb commit 8c59687
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions custom_components/multimatic/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from homeassistant import config_entries, core, exceptions
from homeassistant.const import CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_USERNAME
from homeassistant.core import callback
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.aiohttp_client import async_create_clientsession
import homeassistant.helpers.config_validation as cv

from .const import CONF_SERIAL_NUMBER, DEFAULT_SCAN_INTERVAL, DOMAIN
Expand Down Expand Up @@ -39,7 +39,7 @@ async def validate_authentication(hass, username, password):
"""Ensure provided credentials are working."""
try:
if not await SystemManager(
username, password, async_get_clientsession(hass)
username, password, async_create_clientsession(hass)
).login(True):
raise InvalidAuth
except ApiError as err:
Expand Down
9 changes: 5 additions & 4 deletions custom_components/multimatic/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.aiohttp_client import async_create_clientsession
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator

from .const import (
Expand Down Expand Up @@ -61,7 +61,7 @@ def __init__(self, hass, entry: ConfigEntry):
self._manager = pymultimatic.systemmanager.SystemManager(
user=username,
password=password,
session=async_get_clientsession(hass),
session=async_create_clientsession(hass),
serial=self.serial,
)

Expand Down Expand Up @@ -528,8 +528,9 @@ async def _fetch_data(self):
try:
self.logger.debug("calling %s", self._method)
return await getattr(self.api, self._method)()
except ApiError:
await self._safe_logout()
except ApiError as err:
if err.status == 401:
await self._safe_logout()
raise

async def _fetch_data_if_needed(self):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/multimatic/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"homekit": {},
"dependencies": [],
"codeowners": ["@thomasgermain"],
"version": "1.12.10",
"version": "1.12.11",
"iot_class": "cloud_polling"
}
4 changes: 2 additions & 2 deletions custom_components/multimatic/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"already_configured": "Only one configuration is allowed"
}
},
"options": {
"options": {
"step": {
"init": {
"data": {
Expand All @@ -29,4 +29,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion custom_components/multimatic/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"application": "Applikation",
"serial_number": "Seriennummer"
},
"title": "Verbindungsinformationen (wie in der mutliMATIC / sensoAPP"
"title": "Verbindungsinformationen (wie in der mutliMATIC / sensoAPP)"
}
},
"error": {
Expand Down

0 comments on commit 8c59687

Please sign in to comment.