Skip to content

Commit

Permalink
Bump PyOverkiz and move to Somfy OAuth (#715)
Browse files Browse the repository at this point in the history
* Rewrite coordinator

* Add reauth code back

* Add oauth + debug logging

* Update pyhoma

* Update version

* update deps

* Update to pyhoma 1.3.0

* Update config_flow.py

* Update config_flow.py

* Update coordinator.py
  • Loading branch information
iMicknl authored Jan 25, 2022
1 parent 8da903f commit 70df164
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
14 changes: 7 additions & 7 deletions custom_components/tahoma/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
from aiohttp import ServerDisconnectedError
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from homeassistant.helpers.update_coordinator import (
ConfigEntryAuthFailed,
DataUpdateCoordinator,
UpdateFailed,
)
from homeassistant.util.decorator import Registry
from pyoverkiz.client import OverkizClient
from pyoverkiz.enums import EventName, ExecutionState
Expand Down Expand Up @@ -67,9 +71,7 @@ async def _async_update_data(self) -> dict[str, Device]:
try:
events = await self.client.fetch_events()
except BadCredentialsException as exception:
# Keep retrying until Somfy fixes their servers (https://github.com/iMicknl/ha-tahoma/issues/599)
raise UpdateFailed("Invalid authentication.") from exception
# raise ConfigEntryAuthFailed() from exception
raise ConfigEntryAuthFailed() from exception
except TooManyRequestsException as exception:
raise UpdateFailed("Too many requests, try again later.") from exception
except MaintenanceException as exception:
Expand All @@ -84,9 +86,7 @@ async def _async_update_data(self) -> dict[str, Device]:
await self.client.login()
self.devices = await self._get_devices()
except BadCredentialsException as exception:
# Keep retrying until Somfy fixes their servers (https://github.com/iMicknl/ha-tahoma/issues/599)
raise UpdateFailed("Invalid authentication.") from exception
# raise ConfigEntryAuthFailed() from exception
raise ConfigEntryAuthFailed() from exception
except TooManyRequestsException as exception:
raise UpdateFailed("Too many requests, try again later.") from exception

Expand Down
6 changes: 4 additions & 2 deletions custom_components/tahoma/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/tahoma",
"requirements": [
"pyoverkiz==1.1.1"
"pyoverkiz==1.3.0"
],
"codeowners": [
"@imicknl",
Expand All @@ -14,7 +14,9 @@
],
"issue_tracker": "https://github.com/imicknl/ha-tahoma/issues",
"version": "2.11",
"zeroconf": ["_kizbox._tcp.local."],
"zeroconf": [
"_kizbox._tcp.local."
],
"dhcp": [
{
"hostname": "gateway*",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pyoverkiz==1.1.1
pyoverkiz==1.3.0

0 comments on commit 70df164

Please sign in to comment.