Skip to content

state_trigger not working after disabling and reactivating pyscript #750

@rumpeltux

Description

@rumpeltux

I believe the culprit is here in __init__.py:

    async def hass_started(event: HAEvent) -> None:
        _LOGGER.debug("adding state changed listener and starting global contexts")
        await State.get_service_params()
        hass.data[DOMAIN][UNSUB_LISTENERS].append(hass.bus.async_listen(EVENT_STATE_CHANGED, state_changed))
        start_global_contexts()

The state_changed listener is only setup upon hass_started.
When disabling pyscript, the listener is removed. When re-enabling it, the listener is never re-added.

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