Skip to content

Bug in 1.2.0: @time_active range without date (eg, sunrise, sunset or time) fails all days after HASS started #149

Closed
@markwhibbard

Description

@markwhibbard

Before upgrading to latest release, the following worked as intended. @time_active would cause it to only trigger during the daytime, not at night. However, after the upgrade, the behavior seems to be inverted. Restarting HASS results in correct behavior until the next day.

offset = 20

SCENES = [
    "switch.primary_lights",
    "switch.bedroom_lights",
    "switch.lower_level_lights",
]

@state_trigger(SCENES)
@time_active("range(sunrise + " + str(offset) + "m, sunset - " + str(offset) + "m)")
def auto_brighten(var_name=None, value=None):
    if value=="on":
        base_name = var_name.split('lights')[0]
        switch.turn_on(entity_id=base_name + "bright")

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