public override void AddOrUpdateHSDeviceProperties() { Console.WriteLine("FIXME: Adding HS Device control status"); // hsDevice.MISC_Set(HS, Enums.dvMISC.NO_LOG); hsDevice.MISC_Set(HS, Enums.dvMISC.SHOW_VALUES); hsDevice.set_Relationship(HS, Enums.eRelationship.Standalone); // Clear existing VSP HS.DeviceVSP_ClearAll(hsDevice.get_Ref(null), true); VSVGPairs.VSPair v = new VSVGPairs.VSPair(ePairStatusControl.Status); v.PairType = VSVGPairs.VSVGPairType.SingleValue; v.Value = 0; v.Status = "Closed"; v.Render = Enums.CAPIControlType.Button; v.Render_Location.Row = 1; v.Render_Location.Column = 1; v.ControlUse = ePairControlUse._Off; HS.DeviceVSP_AddPair(hsDevice.get_Ref(null), v); VSVGPairs.VSPair v2 = new VSVGPairs.VSPair(ePairStatusControl.Status); v2.PairType = VSVGPairs.VSVGPairType.SingleValue; v2.Value = 1; v2.Status = "Open"; v2.Render = Enums.CAPIControlType.Button; v2.Render_Location.Row = 1; v2.Render_Location.Column = 2; v2.ControlUse = ePairControlUse._On; HS.DeviceVSP_AddPair(hsDevice.get_Ref(null), v2); SaveConfiguration(); }
public override void AddOrUpdateHSDeviceProperties() { Console.WriteLine("FIXME: Adding HS Device control status"); // hsDevice.MISC_Set(HS, Enums.dvMISC.NO_LOG); hsDevice.MISC_Set(HS, Enums.dvMISC.SHOW_VALUES); hsDevice.set_Relationship(HS, Enums.eRelationship.Standalone); // Clear existing VSP HS.DeviceVSP_ClearAll(hsDevice.get_Ref(null), true); VSVGPairs.VSPair v = new VSVGPairs.VSPair(ePairStatusControl.Status); v.PairType = VSVGPairs.VSVGPairType.Range; var vg = new HomeSeerAPI.VSVGPairs.VGPair(); vg.PairType = VSVGPairs.VSVGPairType.Range; //v.ControlStatus = ePairStatusControl.Status; //v.ControlUse = ePairControlUse. v.RangeStatusSuffix = " C"; v.RangeStart = -50; v.RangeEnd = 100; v.RangeStatusDecimals = 2; vg.RangeStart = -50; vg.RangeEnd = 100; vg.Graphic = "/images/HomeSeer/status/Thermometer-50.png"; v.Render = Enums.CAPIControlType.ValuesRange; hsDevice.MISC_Clear(HS, Enums.dvMISC.SHOW_VALUES); // Should be set or not ? HS.DeviceVSP_AddPair(hsDevice.get_Ref(null), v); HS.DeviceVGP_AddPair(hsDevice.get_Ref(null), vg); /* * VSVGPairs.VSPair v = new VSVGPairs.VSPair(ePairStatusControl.Status); * v.PairType = VSVGPairs.VSVGPairType.SingleValue; * v.Value = 0; * v.Status = "Closed"; * v.Render = Enums.CAPIControlType.Button; * v.Render_Location.Row = 1; * v.Render_Location.Column = 1; * v.ControlUse = ePairControlUse._Off; * HS.DeviceVSP_AddPair(hsDevice.get_Ref(null), v); * * VSVGPairs.VSPair v2 = new VSVGPairs.VSPair(ePairStatusControl.Status); * v2.PairType = VSVGPairs.VSVGPairType.SingleValue; * v2.Value = 1; * v2.Status = "Open"; * v2.Render = Enums.CAPIControlType.Button; * v2.Render_Location.Row = 1; * v2.Render_Location.Column = 2; * v2.ControlUse = ePairControlUse._On; * HS.DeviceVSP_AddPair(hsDevice.get_Ref(null), v2); */ SaveConfiguration(); }