Skip to content

Commit

Permalink
Add constant for sleep times
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstroker committed Jul 5, 2021
1 parent 01d59cb commit 07da802
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/measure/measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
SHELLY_IP = "192.168.178.254"
HUE_BRIDGE_IP = "192.168.178.44"
SLEEP_TIME = 2 # time between changing the light params and taking the measurement
SLEEP_TIME_HUE = 5 # time to wait between each increase in hue
SLEEP_TIME_SAT = 10 # time to wait between each increase in saturation

# Change this when the script crashes due to connectivity issues, so you don't have to start all over again
START_BRIGHTNESS = 1
Expand Down Expand Up @@ -132,8 +134,9 @@ async def get_ct_variations(light: Light):
async def get_hs_variations():
for bri in inclusive_range(START_BRIGHTNESS, MAX_BRIGHTNESS, 10):
for sat in inclusive_range(1, 254, 10):
await asyncio.sleep(10)
await asyncio.sleep(SLEEP_TIME_SAT)
for hue in inclusive_range(1, 65535, 2000):
await asyncio.sleep(SLEEP_TIME_HUE)
yield {"bri": bri, "hue": hue, "sat": sat}


Expand Down

0 comments on commit 07da802

Please sign in to comment.