Skip to content

variables undefined after task.sleep #37

Closed
@dlashua

Description

@dlashua

This issue is dependent on ... something else ... that I can't quite figure out. It doesn't happen every time, so a simplified test doesn't show the issue immediately.

In a Class Method:

        start_sleep = time.monotonic()
        task.sleep(self.timeout)
        elapsed_sleep = time.monotonic() - start_sleep

Error:

2020-10-11 06:14:12 ERROR (MainThread) [custom_components.pyscript.apps.occupancy_manager.inner_occupied_states] Exception in <apps.occupancy_manager.inner_occupied_states> line 224:
            elapsed_sleep = time.monotonic() - start_sleep
                                               ^
NameError: name 'start_sleep' is not defined

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