Sendet nun zusätzlich per http-POST
This commit is contained in:
4
davis.js
4
davis.js
@@ -167,7 +167,8 @@ function parseLOOP1(pkt) {
|
||||
const mph = (raw) => raw === 255 ? null : +(raw * 1.60934).toFixed(1);
|
||||
const r1 = (v) => v !== null && v !== undefined ? +v.toFixed(1) : null;
|
||||
|
||||
const press = pkt.readUInt16LE(7);
|
||||
const press = pkt.readUInt16LE(7);
|
||||
const barTrend = pkt.readInt8(3); // 80 = noch keine Trendinformation
|
||||
|
||||
return {
|
||||
time: new Date(),
|
||||
@@ -180,6 +181,7 @@ function parseLOOP1(pkt) {
|
||||
windDir: degToDir(pkt.readUInt16LE(16)),
|
||||
forecast: pkt[89],
|
||||
pressure: press === 0 ? null : r1(press * 33.8639 / 1000),
|
||||
barTrend: barTrend === 80 ? null : barTrend,
|
||||
rain: +(pkt.readUInt16LE(50) * RAIN_CLICK).toFixed(1),
|
||||
rainRate: +(pkt.readUInt16LE(41) * RAIN_CLICK).toFixed(1),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user