weather-streamoverlay/controller/sensorhub.js

19 lines
366 B
JavaScript

import SensorHub from 'dockerpi-sensorhub';
export class Hub {
constructor() {
let hub = new SensorHub();
if (!hub || !hub.read) throw new Error('Unable to init the hub.');
this.hub = hub;
}
async getTemp() {
let x = null;
await this.hub.read().then(c=>{
x = c;
})
return x;
}
}