I'm trying to use the global methods from a C# script and having no luck. From what I read, the ScriptingReferences settings in the settings.ini file only applies for VB scripts. Instead, for C# it sounds like the correct method is the first line in my script. This is the complete script:
I've tried it using the complete path to the DLL, and with and without the using statement, but all I get in the log is this:
Any ideas?
Code:
//css_reference tenGlobalMethods.dll; using tenGlobalMethods; using HomeSeerAPI; using System.Text.RegularExpressions; using HomeSeer.PluginSdk.Devices; using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System; public object Main(string parm) { CAPI.CAPIControl cc; CAPI.CAPIControlResponse cr; List<int> LightRefs = tenGlobalMethods.GetRefsByCategoryName(hs4, "Lights"); foreach (int LightRef in LightRefs) { cc = hs.CAPIGetSingleControl(LightRef, true, "Off", false, false); cr = hs.CAPIControlHandler(cc); } hs.WriteLog("All Lighs Off", "Done"); return 0; }
Code:
Compiling script (3)AllLightsOff.cs: {interactive}(78,31): error CS0103: The name `tenGlobalMethods' does not exist in the current context {interactive}(78,48): error CS0023: The `.' operator cannot be applied to operand of type `' {interactive}(72,34): warning CS0219: The variable `cr' is assigned but its value is never used {interactive}(41,36): warning CS0414: The private field `Script.hs4' is assigned but its value is never used ->Check your scripting references in settings.ini, they are case sensitive.
Comment