genielabs / HomeGenie

HomeGenie, the programmable automation intelligence
https://homegenie.it
GNU General Public License v3.0
392 stars 155 forks source link

Add Combined Statistics Temperature-Humidity in the same graph for Double Sensors. Change Multiple by Detail #224

Closed dmayard closed 1 year ago

dmayard commented 8 years ago

Hi Gene, look that forum topic : http://www.homegenie.it/forum/index.php?topic=129.msg6521#msg6521 for see a screnshot.

Cheers Dani

genemars commented 8 years ago

Hi dani, I think you should start a new branch "stats" and work there. Anyway this needs more thinking as too much custom code is being added to the statistics class. This is not good. Always prefer generic solutions. For example instead of "stats double" with fixed parameters why not just calling the existing method twice for each field name and so do all the job from the javascript side. this way the user could add more than just two fields, and pick them from a checkbox options list.

dmayard commented 8 years ago

Hi Gene,

I agree with you. But I am a little newbye with javascript. It's possible to include 2 nested calls to the web : $.ajax({ url: '/' + HG.WebApp.Data.ServiceKey + '/' + HG.WebApp.Data.ServiceDomain + '/Statistics/Parameter.StatsHours' .... type: 'GET', success: function (data) { var stats = eval(data); $.ajax({ url: '/' + HG.WebApp.Data.ServiceKey + '/' + HG.WebApp.Data.ServiceDomain + '/Statistics/Parameter.StatsHours' .... type: 'GET', success: function (data) { var stats1 = eval(data); ... ... }); });

Isn't it ?

Le 15/09/2015 14:27, Gene a écrit :

Hi dani, I think you should start a new branch "stats" and work there. Anyway this needs more thinking as too much custom code is being added to the statistics class. This is not good. Always prefer generic solutions. For example instead of "stats double" with fixed parameters why not just calling the existing method twice for each field name and so do all the job from the javascript side. this way the user could add more than just two fields, and pick them from a checkbox options list.

— Reply to this email directly or view it on GitHub https://github.com/genielabs/HomeGenie/pull/224#issuecomment-140372531.

genemars commented 8 years ago

just make a function of this and call it twice

dmayard commented 8 years ago

Hi Gene, I was absent 2 weeks. I try in the Options of statistics to use DropdownListBox Multi checked list in Jquery for that. When I add attribute : multiple or multiple="multiple" to the select field, the dropdown list doesn't open, the multicheck seems to work because sometimes I heve two element selected in the text field. But it happens by clicking the dropdown text many times without coherence. Have you some samples ?