Skip to content

Commit

Permalink
Added INFO message
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemanspiff2007 committed Nov 28, 2024
1 parent 28d0447 commit c24d076
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/HABApp/openhab/connection/plugins/wait_for_startlevel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import asyncio
import logging

import HABApp
import HABApp.core
Expand Down Expand Up @@ -30,6 +31,16 @@ async def __on_connected_new(self, context: OpenhabContext, connection: OpenhabC
# If openHAB is already running we have a fast exit path here
if system_info.uptime >= oh_general.min_uptime and system_info.start_level >= oh_general.min_start_level:
context.waited_for_openhab = False

# Show a hint in case it's possible to increase the start level
# A higher start level means a more consistent startup and thus is more desirable
if system_info.start_level > oh_general.min_start_level:
logging.getLogger('HABApp').info(
f'Openhab reached start level {system_info.start_level:d} but HABApp only waits until '
f'level {oh_general.min_start_level:d} is reached. '
f'Consider increasing "min_start_level" in the HABApp configuration. '
)

return None

log = connection.log
Expand Down

0 comments on commit c24d076

Please sign in to comment.