Linux: Ubuntu 14.04 LTS
HS3: HS3 Pro Edition 3.0.0.94 (Linux)
I just receintly moved my HS3 setup from Windows to Linux (Ubuntu 14.04 LTS) and I am trying to convert a perl script I had to C# (just learning). I am stumped on how to access the DeviceClass from within a C# script. I wrote a little test script which is failing:
...and throws the following error in the log:
Jun-10 05:05:57 Error Compiling script /home/scott/HomeSeer/scripts/test4.cs: The expression did not set a result
If I comment out the two DeviceClass lines above as...
... then the script runs fine with the following output:
Jun-10 05:25:44 test4 dv: TRUE
Jun-10 05:25:44 test4 dvRef: TRUE
Jun-10 05:25:44 test4 addr=192.168.10.210 input1state
Can someone shed some light as to what I am doing wrong?
Thanks,
-Scott
HS3: HS3 Pro Edition 3.0.0.94 (Linux)
I just receintly moved my HS3 setup from Windows to Linux (Ubuntu 14.04 LTS) and I am trying to convert a perl script I had to C# (just learning). I am stumped on how to access the DeviceClass from within a C# script. I wrote a little test script which is failing:
Code:
public void main(object[] Parms) { var test = "test4"; var addr = "192.168.10.210 input1state"; hs.WriteLog(test, "addr=" + addr); int dvRef = hs.DeviceExistsAddress(addr, false); if (dvRef != -1) { hs.WriteLog(test, "dvRef: TRUE"); object dv = hs.GetDeviceByRef(dvRef); if (dv != null) { hs.WriteLog(test, "dv: TRUE"); string loc = dv.Location(hs); // <-- this line throws the error hs.WriteLog(test, "loc=" + loc); } else { hs.WriteLog(test, "dv: FALSE"); } } else { hs.WriteLog(test, "dvRef: FALSE"); } }
Jun-10 05:05:57 Error Compiling script /home/scott/HomeSeer/scripts/test4.cs: The expression did not set a result
If I comment out the two DeviceClass lines above as...
Code:
public void main(object[] Parms) { var test = "test4"; var addr = "192.168.10.210 input1state"; hs.WriteLog(test, "addr=" + addr); int dvRef = hs.DeviceExistsAddress(addr, false); if (dvRef != -1) { hs.WriteLog(test, "dvRef: TRUE"); object dv = hs.GetDeviceByRef(dvRef); if (dv != null) { hs.WriteLog(test, "dv: TRUE"); // string loc = dv.Location(hs); // hs.WriteLog(test, "loc=" + loc); } else { hs.WriteLog(test, "dv: FALSE"); } } else { hs.WriteLog(test, "dvRef: FALSE"); } }
Jun-10 05:25:44 test4 dv: TRUE
Jun-10 05:25:44 test4 dvRef: TRUE
Jun-10 05:25:44 test4 addr=192.168.10.210 input1state
Can someone shed some light as to what I am doing wrong?
Thanks,
-Scott
Comment