{"action":"closed","issue":{"url":"https://api.github.com/repos/home-assistant/home-assistant/issues/12145","repository_url":"https://api.github.com/repos/home-assistant/home-assistant","labels_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/12145/labels{/name}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/12145/comments","events_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/12145/events","html_url":"https://github.com/home-assistant/home-assistant/issues/12145","id":294097960,"node_id":"MDU6SXNzdWUyOTQwOTc5NjA=","number":12145,"title":"Sensor theThingsNetwork storage integration only returns the oldest value and not the newest","user":{"login":"jh83","id":16517831,"node_id":"MDQ6VXNlcjE2NTE3ODMx","avatar_url":"https://avatars3.githubusercontent.com/u/16517831?v=4","gravatar_id":"","url":"https://api.github.com/users/jh83","html_url":"https://github.com/jh83","followers_url":"https://api.github.com/users/jh83/followers","following_url":"https://api.github.com/users/jh83/following{/other_user}","gists_url":"https://api.github.com/users/jh83/gists{/gist_id}","starred_url":"https://api.github.com/users/jh83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jh83/subscriptions","organizations_url":"https://api.github.com/users/jh83/orgs","repos_url":"https://api.github.com/users/jh83/repos","events_url":"https://api.github.com/users/jh83/events{/privacy}","received_events_url":"https://api.github.com/users/jh83/received_events","type":"User","site_admin":false},"labels":[{"id":562804248,"node_id":"MDU6TGFiZWw1NjI4MDQyNDg=","url":"https://api.github.com/repos/home-assistant/home-assistant/labels/waiting-for-reply","name":"waiting-for-reply","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":{"login":"fabaff","id":116184,"node_id":"MDQ6VXNlcjExNjE4NA==","avatar_url":"https://avatars0.githubusercontent.com/u/116184?v=4","gravatar_id":"","url":"https://api.github.com/users/fabaff","html_url":"https://github.com/fabaff","followers_url":"https://api.github.com/users/fabaff/followers","following_url":"https://api.github.com/users/fabaff/following{/other_user}","gists_url":"https://api.github.com/users/fabaff/gists{/gist_id}","starred_url":"https://api.github.com/users/fabaff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabaff/subscriptions","organizations_url":"https://api.github.com/users/fabaff/orgs","repos_url":"https://api.github.com/users/fabaff/repos","events_url":"https://api.github.com/users/fabaff/events{/privacy}","received_events_url":"https://api.github.com/users/fabaff/received_events","type":"User","site_admin":false},"assignees":[{"login":"fabaff","id":116184,"node_id":"MDQ6VXNlcjExNjE4NA==","avatar_url":"https://avatars0.githubusercontent.com/u/116184?v=4","gravatar_id":"","url":"https://api.github.com/users/fabaff","html_url":"https://github.com/fabaff","followers_url":"https://api.github.com/users/fabaff/followers","following_url":"https://api.github.com/users/fabaff/following{/other_user}","gists_url":"https://api.github.com/users/fabaff/gists{/gist_id}","starred_url":"https://api.github.com/users/fabaff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabaff/subscriptions","organizations_url":"https://api.github.com/users/fabaff/orgs","repos_url":"https://api.github.com/users/fabaff/repos","events_url":"https://api.github.com/users/fabaff/events{/privacy}","received_events_url":"https://api.github.com/users/fabaff/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-02-03T09:30:07Z","updated_at":"2018-12-14T17:38:40Z","closed_at":"2018-12-14T17:38:40Z","author_association":"NONE","body":"@fabaff. I have noticed that the integration against TTN storage (https://home-assistant.io/components/sensor.thethingsnetwork/) only returns the oldest data from the TTN storage and not the newest. I suppose that this is due to how the data is returned in line 158 in \"home-assistant/homeassistant/components/sensor/thethingsnetwork.py\".\r\n\r\nThis line says:\r\n\"self.data = data[0]\"\r\n\r\nMaybe this can be changed so it returns the newest data instead of the oldest data by changing this row to:\r\n\"self.data = data[len(data) - 1]\"\r\n\r\nAlso, everytime the TTN storage gets queried, it is queried for all data and all data is returned. This is in my case a lot of info when the actual py script the only returns one entry. Maybe it would be possible to add a part to the TTN YAML configuration where we can specify for how long back we want to return dat? \r\n\r\nLets say that i know that im only am interested in the last 300 seconds, then we can have a config in the YAML file that is used when polling TTN storage since TTN API has support for it. Currently i think that it polls the data for the last 7 days.\r\n"}}
{"actor":{"display_login":"balloobbot"}}