{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/smarthome/issues/2405","repository_url":"https://api.github.com/repos/eclipse/smarthome","labels_url":"https://api.github.com/repos/eclipse/smarthome/issues/2405/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/smarthome/issues/2405/comments","events_url":"https://api.github.com/repos/eclipse/smarthome/issues/2405/events","html_url":"https://github.com/eclipse/smarthome/pull/2405","id":187163290,"number":2405,"title":"Fix averageSince calculation","user":{"login":"J-N-K","id":5159123,"avatar_url":"https://avatars.githubusercontent.com/u/5159123?v=3","gravatar_id":"","url":"https://api.github.com/users/J-N-K","html_url":"https://github.com/J-N-K","followers_url":"https://api.github.com/users/J-N-K/followers","following_url":"https://api.github.com/users/J-N-K/following{/other_user}","gists_url":"https://api.github.com/users/J-N-K/gists{/gist_id}","starred_url":"https://api.github.com/users/J-N-K/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/J-N-K/subscriptions","organizations_url":"https://api.github.com/users/J-N-K/orgs","repos_url":"https://api.github.com/users/J-N-K/repos","events_url":"https://api.github.com/users/J-N-K/events{/privacy}","received_events_url":"https://api.github.com/users/J-N-K/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-11-03T19:12:35Z","updated_at":"2016-11-16T13:07:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/eclipse/smarthome/pulls/2405","html_url":"https://github.com/eclipse/smarthome/pull/2405","diff_url":"https://github.com/eclipse/smarthome/pull/2405.diff","patch_url":"https://github.com/eclipse/smarthome/pull/2405.patch"},"body":"Average since is calculated over persisted values AND the actual value.\r\nThe description describes that it is calculated over persisted values OR\r\nthe actual value (if no persisted values are found). The description is\r\ndesribes the correct behaviour, while the implementation was wrong. This\r\nis fixed with this PR.\r\n\r\nBug: https://github.com/eclipse/smarthome/issues/2404\r\nSigned-off-by: Jan N. Klug <jan.n.klug@rub.de>"},"comment":{"url":"https://api.github.com/repos/eclipse/smarthome/issues/comments/260941939","html_url":"https://github.com/eclipse/smarthome/pull/2405#issuecomment-260941939","issue_url":"https://api.github.com/repos/eclipse/smarthome/issues/2405","id":260941939,"user":{"login":"kaikreuzer","id":3244965,"avatar_url":"https://avatars.githubusercontent.com/u/3244965?v=3","gravatar_id":"","url":"https://api.github.com/users/kaikreuzer","html_url":"https://github.com/kaikreuzer","followers_url":"https://api.github.com/users/kaikreuzer/followers","following_url":"https://api.github.com/users/kaikreuzer/following{/other_user}","gists_url":"https://api.github.com/users/kaikreuzer/gists{/gist_id}","starred_url":"https://api.github.com/users/kaikreuzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaikreuzer/subscriptions","organizations_url":"https://api.github.com/users/kaikreuzer/orgs","repos_url":"https://api.github.com/users/kaikreuzer/repos","events_url":"https://api.github.com/users/kaikreuzer/events{/privacy}","received_events_url":"https://api.github.com/users/kaikreuzer/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T13:07:46Z","updated_at":"2016-11-16T13:07:46Z","body":"> From the mathematical point of view (and probably also from the expectation of the user) it would probably be best if you would calculate the integral\r\n\r\nI agree, I think this is the only correct solution to the problem - especially as it will also work if persistence is done on value change and not with a fixed frequency. It shouldn't be too hard to calculate as we only need to additionally consider the time between two values as well."}}
{"actor":{"display_login":"kaikreuzer"}}