Skip to content

Bug: module context starts before Home Assistant #784

@dmamelin

Description

@dmamelin

Module-level triggers start before Home Assistant reaches the RUNNING state

modules/module.py:

@time_trigger
def module_startup():
    log.info(f"Module hass state: {hass.state}")

test.py:

from module import module_startup
@time_trigger
def file_startup():
    log.info(f"File hass state: {hass.state}")

Log on HA startup:

[custom_components.pyscript.modules.module.module_startup] Module hass state: NOT_RUNNING
...few seconds...
[custom_components.pyscript.file.test.file_startup] File hass state: RUNNING

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions