Skip to content

Commit

Permalink
Start hub earlier (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
SukramJ authored Feb 4, 2022
1 parent 169853e commit 19dc4ae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Version 0.30.1 (2022-02-04)
- Start hub earlier

Version 0.30.0 (2022-02-03)
- Add paramset to entity
- Add CHANNEL_OPERATION_MODE for HmIP(W)-DRBL4
Expand Down
17 changes: 9 additions & 8 deletions hahomematic/central_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ async def start(self, check_only: bool = False) -> None:
return None
await self._start_clients()
self._start_connection_checker()
await self._init_hub()

async def _start_clients(self) -> None:
"""Start clients ."""
if await self._create_clients():
await self._load_caches()
await self._create_devices()
await self._init_hub()
await self._init_clients()

async def stop(self) -> None:
Expand Down Expand Up @@ -286,13 +286,14 @@ def _create_hub(self) -> HmHub | HmDummyHub:

async def _init_hub(self) -> None:
"""Init the hub."""
self.hub = self._create_hub()
_LOGGER.info(
"init_hub: Starting hub for %s",
self.instance_name,
)
if isinstance(self.hub, HmHub):
await self.hub.fetch_data()
if not self.hub:
self.hub = self._create_hub()
_LOGGER.info(
"init_hub: Starting hub for %s",
self.instance_name,
)
if self.hub and isinstance(self.hub, HmHub):
await self.hub.fetch_data()

def _start_connection_checker(self) -> None:
"""Start the connection checker."""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def readme():
},
PACKAGE_NAME = "hahomematic"
HERE = os.path.abspath(os.path.dirname(__file__))
VERSION = "0.30.0"
VERSION = "0.30.1"

PACKAGES = find_packages(exclude=["tests", "tests.*", "dist", "build"])

Expand Down

0 comments on commit 19dc4ae

Please sign in to comment.