Skip to content

Commit

Permalink
fix ZeroDivisionError: division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
hendriksen-mark committed Sep 26, 2024
1 parent 87ee0bc commit d782696
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion BridgeEmulator/HueObjects/Group.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def update_state(self):
else:
all_on = False
if any_on:
bri = (((bri/lights_on)/254)*100)
bri = (((bri/lights_on)/254)*100) if bri > 0 else 0
return {"all_on": all_on, "any_on": any_on, "avr_bri": int(bri)}

def setV2Action(self, state):
Expand Down

0 comments on commit d782696

Please sign in to comment.