2024-12-21 01:56:50 +00:00
|
|
|
import fs from 'fs'
|
|
|
|
import axios from 'axios'
|
2024-12-18 02:15:50 +00:00
|
|
|
let config = JSON.parse(fs.readFileSync('config.json', 'utf8'))
|
|
|
|
|
2024-12-18 04:24:19 +00:00
|
|
|
axios.get(`http://${config.servers.deconz.url}:${config.servers.deconz.apiPort}/api/${config.servers.deconz.apiKey}/sensors`)
|
2024-12-18 02:15:50 +00:00
|
|
|
.then(response => {
|
2024-12-21 01:56:50 +00:00
|
|
|
console.log(response.data)
|
2024-12-18 02:15:50 +00:00
|
|
|
fs.writeFileSync('devices.json', JSON.stringify(response.data, null, 2))
|
|
|
|
})
|