bt-sensors-plugin-sk 1.1.0-beta.2.1.4.1 → 1.1.0-beta.2.1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +1 -1
- package/sensor_classes/MopekaTankSensor.js +5 -2
package/index.js
CHANGED
|
@@ -414,7 +414,7 @@ module.exports = function (app) {
|
|
|
414
414
|
if (plugin.schema.properties.peripherals.items.dependencies)
|
|
415
415
|
plugin.schema.properties.peripherals.items.dependencies.mac_address.oneOf=[]
|
|
416
416
|
} else {
|
|
417
|
-
app.debug('Plugin build
|
|
417
|
+
app.debug('Plugin build Beta 2.4.1.2 started');
|
|
418
418
|
|
|
419
419
|
}
|
|
420
420
|
starts++
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bt-sensors-plugin-sk",
|
|
3
|
-
"version": "1.1.0-beta.2.1.4.
|
|
3
|
+
"version": "1.1.0-beta.2.1.4.2",
|
|
4
4
|
"description": "Bluetooth Sensors for Signalk -- support for Victron devices, RuuviTag, Xiaomi, ATC and Inkbird, Ultrasonic, Mopeka tank reader and preliminary support for Govee GVH51xx temp sensors",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -267,7 +267,7 @@ class MopekaTankSensor extends BTSensor{
|
|
|
267
267
|
|
|
268
268
|
_tankLevel( rawLevel ){
|
|
269
269
|
const coefs= this.getMedium().coefficients
|
|
270
|
-
return rawLevel * (coefs[0] + (coefs[1] * this.temp) + (coefs[2] * (this.temp^2)))
|
|
270
|
+
return rawLevel * (coefs[0] + (coefs[1] * (this.temp-273.15)) + (coefs[2] * ((this.temp-273.15)^2)))
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
initMetadata(){
|
|
@@ -275,6 +275,9 @@ class MopekaTankSensor extends BTSensor{
|
|
|
275
275
|
md.isParam=true
|
|
276
276
|
md.enum=Object.keys(Media)
|
|
277
277
|
|
|
278
|
+
md = this.addMetadatum("tankHeight","mm","height of tank (in mm)")
|
|
279
|
+
md.isParam=true
|
|
280
|
+
|
|
278
281
|
this.addMetadatum("battVolt","V","sensor battery in volts",
|
|
279
282
|
((buffer)=>{
|
|
280
283
|
this.battVolt = (buffer.readUInt8(1)/32)
|
|
@@ -291,7 +294,7 @@ class MopekaTankSensor extends BTSensor{
|
|
|
291
294
|
}).bind(this)
|
|
292
295
|
)
|
|
293
296
|
this.addMetadatum("tankLevel","m","tank level",
|
|
294
|
-
(buffer)=>{ return this._tankLevel(((buffer.readUInt16LE(3))&0x3FFF)
|
|
297
|
+
(buffer)=>{ return this._tankLevel(((buffer.readUInt16LE(3))&0x3FFF))}
|
|
295
298
|
)
|
|
296
299
|
this.addMetadatum("readingQuality","","quality of read",
|
|
297
300
|
(buffer)=>{ return buffer.readUInt8(4)>>6}
|