Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemanspiff2007 committed Nov 29, 2024
1 parent c24d076 commit 8249f8e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/HABApp/openhab/connection/plugins/wait_for_startlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import HABApp
import HABApp.core
import HABApp.openhab.events
from HABApp.config.models.openhab import General as OpenHABGeneralConfig
from HABApp.core import shutdown
from HABApp.core.connections import BaseConnectionPlugin
from HABApp.core.lib import Timeout, ValueChange
Expand Down Expand Up @@ -35,10 +36,14 @@ async def __on_connected_new(self, context: OpenhabContext, connection: OpenhabC
# 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:
_field_name_cfg = 'min_start_level'
if (alias := OpenHABGeneralConfig.model_fields[_field_name_cfg].alias) is not None:
_field_name_cfg = alias

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. '
f'Consider increasing "{_field_name_cfg:s}" in the HABApp configuration. '
)

return None
Expand Down

0 comments on commit 8249f8e

Please sign in to comment.