Update imports
This commit is contained in:
parent
0dbf6fdc4f
commit
7e61941789
@ -1,9 +1,9 @@
|
|||||||
const axios = require('axios')
|
import fs from 'fs'
|
||||||
const fs = require('fs')
|
import axios from 'axios'
|
||||||
let config = JSON.parse(fs.readFileSync('config.json', 'utf8'))
|
let config = JSON.parse(fs.readFileSync('config.json', 'utf8'))
|
||||||
|
|
||||||
axios.get(`http://${config.servers.deconz.url}:${config.servers.deconz.apiPort}/api/${config.servers.deconz.apiKey}/sensors`)
|
axios.get(`http://${config.servers.deconz.url}:${config.servers.deconz.apiPort}/api/${config.servers.deconz.apiKey}/sensors`)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
// console.log(response.data)
|
console.log(response.data)
|
||||||
fs.writeFileSync('devices.json', JSON.stringify(response.data, null, 2))
|
fs.writeFileSync('devices.json', JSON.stringify(response.data, null, 2))
|
||||||
})
|
})
|
Loading…
Reference in New Issue
Block a user