Is $(internal:all_ip) an array of strings? #2997
-
Is $(internal:all_ip) an array of strings? Or something else? Trying to set a trigger that checks if the Stream Deck is connected to a computer with a specific IP address, in this case 192.168.1.34. So I set the trigger event 'becoming true', condition to $(internal:all_ip).includes('192.168.1.34'), action enable 'another' trigger. So if I understand this triggers logic, when the stream deck, i.e. surface, is connected to the computer with ip address of 192.168.1.34, this trigger should resolve to 'true' state, and action fires. But this does not seem to work. The 'includes' directive should work if all_ip is array of ip addresses which are strings. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Its a single string. There is an |
Beta Was this translation helpful? Give feedback.
-
Not JavaScript... Interesting I have done some rather complex expressions thinking it was JavaScript... and they worked! Guess I got lucky thus far. For is if I do... includes($internal:all_ip), "192.168.1.34") and 192.168.1.34... exists returns true.... ok, will give it a shot. |
Beta Was this translation helpful? Give feedback.
-
@Julusian What is really odd... is that the includes() returns 'true' if the sub-string is found, but empty string when not found. That was really odd IMHO. But I worked around the odd return result, so now, I have a trigger that is device/machine specific, i.e. i can enable and disable connections and triggers based on where the stream desk is connected, and have one configuration file across all the devices the stream deck may be connected to at any one time. This really makes it easy to avoid having unique configuration files for each device, and update each unique device configuration when we make changes common across all devices. |
Beta Was this translation helpful? Give feedback.
-
Just an after thought... if you create a variable... that has the device name or such? And that can be a trigger condition, say 'if variable $(interal:HostName) == 'somehostname', that would be a nice feature add. thinking you could just drop the /etc/hostname value (Linux, MacOS) into a variable? On Windows %computername%. |
Beta Was this translation helpful? Give feedback.
-
That is really cool. Thanks for the information. |
Beta Was this translation helpful? Give feedback.
Its a single string.
But also your syntax is wrong, as expressions aren't true javascript.
There is an
includes
method which will work which has an example in the docsincludes("Companion is great!", "great")