const AmbientWeatherApi = require("ambient-weather-api") const api = new AmbientWeatherApi({ apiKey: '78f9704baaab411a87edeed59052cbb687a4aa7764a44accbaf6447492b0ca8c', applicationKey: '21a439e927a84a25bb79ffe894fdd372b3e9d2e8bcef4167943b52cbe4530d9f' }) api.userDevices() .then((devices) => { const device = devices[0] console.log('3 most recent temperature reports for ' + device.info.name + ':') return api.deviceData(device.macAddress, { limit: 3 } ) }) .then((deviceData) => { deviceData.forEach(data => console.log(data.date + ' - ' + data.tempf + '°F')) })
Save on
Powered by
Node 8.11.1
help
Loading…