Implement changes to the data from the analytics site (#17572)

This commit is contained in:
Joakim Sørensen 2021-04-29 12:52:54 +02:00 committed by GitHub
parent 0f09559ca3
commit a39c8a290a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,10 +185,9 @@ task :analytics_data do
uri = URI('https://analytics.home-assistant.io/data.json')
remote_data = JSON.parse(Net::HTTP.get(uri))
last_entry=remote_data.keys().sort().reverse()[0]
File.open("#{source_dir}/_data/analytics_data.json", "w") do |file|
file.write(JSON.generate(remote_data[last_entry]))
file.write(JSON.generate(remote_data['current']))
end
end