Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmotea committed Sep 24, 2024
1 parent 7080996 commit c56afba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion BridgeEmulator/HueObjects/Group.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def setV1Action(self, state, scene=None):
v2State = v1StateToV2(state)
self.genStreamEvent(v2State)


def genStreamEvent(self, v2State):
streamMessage = {"creationtime": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
"data": [],
Expand All @@ -163,7 +164,7 @@ def genStreamEvent(self, v2State):
"id": light.id_v2,
"id_v1": "/lights/" + light.id_v1,
"owner": {
"rid": light().getDevice()["id"],
"rid": self.id_v2,
"rtype":"device"
},
"service_id": light.protocol_cfg["light_nr"]-1 if "light_nr" in light.protocol_cfg else 0,
Expand Down
3 changes: 2 additions & 1 deletion BridgeEmulator/functions/behavior_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,11 @@ def checkBehaviorInstances(device):
resource.setV1Action({"bri_inc": +30})
elif instance.configuration["buttons"][button][buttonAction]["action"] == "dim_down":
resource.setV1Action({"bri_inc": -30})

elif device.modelid == "SML001": # Motion Sensor
if "settings" in instance.configuration:
if "daylight_sensitivity" in instance.configuration["settings"]:
if device.elements["ZLLLightLevel"]().protocol_cfg["lightSensor"] == "on":
device.elements["ZLLLightLevel"]().state["lightlevel"] = 25000 if bridgeConfig["sensors"]["1"].state["daylight"] else 6000
if instance.configuration["settings"]["daylight_sensitivity"]["dark_threshold"] >= device.elements["ZLLLightLevel"]().state["lightlevel"]:
logging.debug("Light ok")
else:
Expand Down

0 comments on commit c56afba

Please sign in to comment.