def METHOD_NAME(self, entity, attribute, old, new, kwargs):
    # Use light levels to switch to Day or Evening modes as appropriate
    lux = float(new)
    if self.mode == "Morning" or self.mode == "Night" and self.now_is_between("sunrise", "12:00:00"):
        if lux > 200:
            self.day()
    if self.mode == "Day" and self.now_is_between("sunset - 02:00:00", "sunset"):
        if lux < 200:
            self.evening()