Hi Gene,
I've made the modification but the widget doesn't refresh itself, I must reload the page or change the page and go again to the page that display this widget in order to see the value updated.
This is an extract of the log file :
2015-11-29 20:33:26.9178 Info HomeAutomation.SystemChecker 1 Virtual Module Program.UiRefresh Data Updated
2015-11-29 20:33:31.9175 Info HomeAutomation.SystemChecker 1 Virtual Module Program.UiRefresh Data Updated
2015-11-29 20:33:36.9175 Info HomeAutomation.SystemChecker 1 Virtual Module Program.UiRefresh Data Updated
2015-11-29 20:33:37.3154 Info WebServiceGateway 192.168.0.1 HTTP GET 200 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [CLOSED AFTER 0 seconds]
2015-11-29 20:33:37.3154 Info WebServiceGateway 192.168.0.1 HTTP GET 200 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [OPEN]
2015-11-29 20:33:41.9185 Info HomeAutomation.SystemChecker 1 Virtual Module Program.UiRefresh Data Updated
2015-11-29 20:33:46.9175 Info HomeAutomation.SystemChecker 1 Virtual Module Program.UiRefresh Data Updated
2015-11-29 20:33:47.3194 Info WebServiceGateway 192.168.0.1 HTTP GET 200 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [CLOSED AFTER 0 seconds]
2015-11-29 20:33:47.3189 Info WebServiceGateway 192.168.0.1 HTTP GET 200 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [OPEN]
2015-11-29 20:33:51.9176 Info HomeAutomation.SystemChecker 1 Virtual Module Program.UiRefresh Data Updated
2015-11-29 20:33:54.3640 Info HomeAutomation.PhilipsHue 1 - Meter.Watts 0.0
2015-11-29 20:33:54.3831 Info HomeAutomation.PhilipsHue 2 - Meter.Watts 0.0
2015-11-29 20:33:54.3943 Info HomeAutomation.PhilipsHue 3 - Meter.Watts 0.0
2015-11-29 20:33:56.9175 Info HomeAutomation.SystemChecker 1 Virtual Module Program.UiRefresh Data Updated
2015-11-29 20:33:58.3242 Info WebServiceGateway 192.168.0.1 HTTP GET 200 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [CLOSED AFTER 0 seconds]
2015-11-29 20:33:58.3242 Info WebServiceGateway 192.168.0.1 HTTP GET 200 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [OPEN]
2015-11-29 20:34:01.9183 Info HomeAutomation.SystemChecker 1 Virtual Module Program.UiRefresh Data Updated
2015-11-29 20:34:06.9177 Info HomeAutomation.SystemChecker 1 Virtual Module Program.UiRefresh Data Updated
2015-11-29 20:34:09.3224 Info WebServiceGateway 192.168.0.1 HTTP GET 200 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [CLOSED AFTER 0 seconds]
2015-11-29 20:34:09.3224 Info WebServiceGateway 192.168.0.1 HTTP GET 200 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [OPEN]
We can see that the refresh event appear every 5 secondes and it's what I ask but the widget never update if I stay on the page which display it.
I update value like that :
var UpdateParamterValue = new Func<ModuleHelper,string,string,bool> ((module,param,val) => {
if (module.Parameter(param).Value != val)
{
//Program.Notify("SystemChecker", param + " : " + module.Parameter(param).Value + "->" + val);
module.Parameter(param).Value = val;
//Program.RaiseEvent(module, param, val, "Update " + param);
return true;
}
return false;
});
...
...
...
//Check for update only if needed
var needUpdate = UpdateParamterValue(systemSensor,"Sensor.System.Disk",newDiskVal);
needUpdate |= UpdateParamterValue(systemSensor,"Sensor.System.CPU",newCPUVal);
needUpdate |= UpdateParamterValue(systemSensor,"Sensor.System.Memory",newMemoryVal);
if (needUpdate)
Program.RaiseEvent(systemSensor,"Program.UiRefresh", "Data Updated", "");
...
...
...
Thanks