Skip to content

Commit

Permalink
fix AttributeError: 'list' object has no attribute 'name'
Browse files Browse the repository at this point in the history
  • Loading branch information
hendriksen-mark committed Oct 1, 2024
1 parent 5d00e37 commit 4117a2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions BridgeEmulator/functions/daylightSensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def daylightSensor(tz, sensor):#tz = timezone
logging.debug("sleep finish at " + current_time.strftime("%Y-%m-%dT%H:%M:%S"))
sensor.state = {"daylight":False,"lastupdated": current_time.strftime("%Y-%m-%dT%H:%M:%S")}
sensor.dxState["daylight"] = current_time
rulesProcessor(["sensors","1"], current_time)
rulesProcessor(sensor, current_time)
elif deltaSunriseOffset > 0 and deltaSunriseOffset < 3600:
logging.info("will start the sleep for sunrise")
sleep(deltaSunriseOffset)
logging.debug("sleep finish at " + current_time.strftime("%Y-%m-%dT%H:%M:%S"))
sensor.state = {"daylight":True,"lastupdated": current_time.strftime("%Y-%m-%dT%H:%M:%S")}
sensor.dxState["daylight"] = current_time
rulesProcessor(["sensors","1"], current_time)
rulesProcessor(sensor, current_time)
# v2 api routines
for key, instance in bridgeConfig["behavior_instance"].items():
if "when_extended" in instance.configuration:
Expand Down

0 comments on commit 4117a2a

Please sign in to comment.