public IPlugInAPI.PollResultInfo PollDevice(int dvref) { Console.WriteLine("PollDevice"); IPlugInAPI.PollResultInfo ri = default(IPlugInAPI.PollResultInfo); ri.Result = IPlugInAPI.enumPollResult.OK; return(ri); }
/// <summary> /// If a device is owned by your plug-in (interface property set to the name of the plug-in) and the device's status_support property is set to True, /// then this procedure will be called in your plug-in when the device's status is being polled, such as when the user clicks "Poll Devices" on the device status page. /// Normally your plugin will automatically keep the status of its devices updated. /// There may be situations where automatically updating devices is not possible or CPU intensive. /// In these cases the plug-in may not keep the devices updated. HomeSeer may then call this function to force an update of a specific device. /// This request is normally done when a user displays the status page, or a script runs and needs to be sure it has the latest status. /// </summary> /// <param name="dvref">Reference Id for the device</param> /// <returns>IPlugInAPI.PollResultInfo</returns> public virtual IPlugInAPI.PollResultInfo PollDevice(int dvref) { IPlugInAPI.PollResultInfo pollResult = new IPlugInAPI.PollResultInfo(); pollResult.Result = IPlugInAPI.enumPollResult.Device_Not_Found; pollResult.Value = 0; return(pollResult); }
public override IPlugInAPI.PollResultInfo PollDevice(int deviceId) { var pollResult = new IPlugInAPI.PollResultInfo { Result = IPlugInAPI.enumPollResult.Device_Not_Found, Value = 0 }; return(pollResult); }
public override IPlugInAPI.PollResultInfo PollDevice(int deviceId) { if (ImportDeviceFromDB(deviceId)) { var pollResult = new IPlugInAPI.PollResultInfo { Result = IPlugInAPI.enumPollResult.OK, Value = HS.DeviceValueEx(deviceId), }; return(pollResult); } else { return(base.PollDevice(deviceId)); } }
/// <summary> /// If a device is owned by your plug-in (interface property set to the name of the plug-in) and the device's status_support property is set to True, /// then this procedure will be called in your plug-in when the device's status is being polled, such as when the user clicks "Poll Devices" on the device status page. /// Normally your plugin will automatically keep the status of its devices updated. /// There may be situations where automatically updating devices is not possible or CPU intensive. /// In these cases the plug-in may not keep the devices updated. HomeSeer may then call this function to force an update of a specific device. /// This request is normally done when a user displays the status page, or a script runs and needs to be sure it has the latest status. /// </summary> /// <param name="dvref">Reference Id for the device</param> /// <returns>IPlugInAPI.PollResultInfo</returns> public override IPlugInAPI.PollResultInfo PollDevice(int dvref) { double status = -1; IPlugInAPI.PollResultInfo pollResult = new IPlugInAPI.PollResultInfo(); if (HikAlarmThreadManager.GetDeviceStatus(dvref, out status)) { pollResult.Result = IPlugInAPI.enumPollResult.OK; pollResult.Value = status; } else { pollResult.Result = IPlugInAPI.enumPollResult.Device_Not_Found; pollResult.Value = 0; } return(pollResult); }
public IPlugInAPI.PollResultInfo PollDevice(int dvref) { IPlugInAPI.PollResultInfo ri = default(IPlugInAPI.PollResultInfo); if (true) { if (true) { ri.Result = IPlugInAPI.enumPollResult.OK; } else { ri.Result = IPlugInAPI.enumPollResult.Could_Not_Reach_Plugin; } } else { ri.Result = IPlugInAPI.enumPollResult.Device_Not_Found; } return(ri); }
public HomeSeerAPI.IPlugInAPI.PollResultInfo PollDevice(int dvref) { HomeSeerAPI.IPlugInAPI.PollResultInfo r = new IPlugInAPI.PollResultInfo(); return(r); }