Skip to content

Commit

Permalink
Fixed issue with taking/releasing control of leds. Replaced priority …
Browse files Browse the repository at this point in the history
…control with request and release controls
  • Loading branch information
ScreamingOranges committed May 28, 2021
1 parent fbd5456 commit 7e8d298
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
7 changes: 5 additions & 2 deletions icueConnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ def setLedsByDevice(self, device,RGB_val):
sdk.set_led_colors_buffer_by_device_index(device, deviceToLed[device])
sdk.set_led_colors_flush_buffer()

def setPriority(self,value):
sdk.set_layer_priority(value)
def requestControl(self):
sdk.request_control()

def releaseControl(self):
sdk.release_control()

def perform_pulse_effect(self,wave_duration,RGB_val):
time_per_frame = 25
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def checkJsonFile():

def colorResetCall():
conn = icueConnect.icueConnect()
conn.setPriority(0)
conn.releaseControl()
del conn

def main():
Expand Down
7 changes: 4 additions & 3 deletions pusherConnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,17 @@ def my_func(self, *args, **kwargs):
#print(result)
result = json.loads(result)
conn = icueConnect.icueConnect()
conn.setPriority(255)#iCue's priority is 127
if "RGB_PULSE" in result:
conn.requestControl()
RGB_val = result["RGB_PULSE"]
conn.perform_pulse_effect(1000,RGB_val)
conn.setPriority(0)
conn.releaseControl()
elif "RGB_SOLID" in result:
conn.requestControl()
RGB_val = result["RGB_SOLID"]
conn.solidColor(RGB_val)
elif "RGB_RESET" in result:
conn.setPriority(0)
conn.releaseControl()
elif "Request_SubDevices" in result:
print('Received From App')
devices = conn.getDevicesIdMap()
Expand Down

0 comments on commit 7e8d298

Please sign in to comment.