hi guys new to groovy and coding in general, ive stuck some code together which you can see in the following link
the code is obliviously a mess and was to test some functionality out with my sony TV however, I got all the functions working seperatley and now im trying to slim the code down and take out any duplication and also alow the app to enter some of the variables. im working through it now trying to clean it up and ive hit a snag with ‘def’
it appears that something ive Defined in the beginning of the script, cant be called from within another def which is causing my script to run with null values
an example
line 96, this def tv_ip joins all the seperate parts of an IP address together and when i log.debug ("${tv_ip}") i get what i expect in this instance 192.168.0.12
I then call tv_ip again on line 133 but the value is null
can anyone explain to me what im doing wrong? i think its because im using def but i cant figure it out (iff i uncomment line 129 this starts working as normal, but i want this value to be set globally