Conditional Light Effect with WS2182b/NeoPixel Ringlight

Does this code assume that both the light and sensor is on the same controller? Because I have mine on different. Or can I just add this to my sensor code, and it will work regardless of different devices?