9 lines
345 B
JavaScript
9 lines
345 B
JavaScript
const axios = require('axios')
|
|
const fs = require('fs')
|
|
let config = JSON.parse(fs.readFileSync('config.json', 'utf8'))
|
|
|
|
axios.get(config.servers.deconz.url + '/api/' + config.servers.deconz.apiKey + '/sensors')
|
|
.then(response => {
|
|
// console.log(response.data)
|
|
fs.writeFileSync('devices.json', JSON.stringify(response.data, null, 2))
|
|
}) |