bt-sensors-plugin-sk 1.1.0-beta.2.2.1.1 → 1.1.0-beta.2.2.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bt-sensors-plugin-sk",
3
- "version": "1.1.0-beta.2.2.1.1",
3
+ "version": "1.1.0-beta.2.2.1.3",
4
4
  "description": "Bluetooth Sensors for Signalk -- support for Victron devices, RuuviTag, Xiaomi, ATC and Inkbird, Ultrasonic wind meters, Mopeka tank readers, Renogy Battery and Solar Controllers (new), Aranet4 environment sensors, and Govee GVH51xx temp sensors",
5
5
  "main": "index.js",
6
6
  "dependencies": {
@@ -19,8 +19,7 @@ class UltrasonicWindMeter extends BTSensor{
19
19
  )
20
20
  this.awsCharacteristic.readValue()
21
21
  .then((buffer)=>
22
- this.emitData("aws", buffer)
23
-
22
+ this.emitData("aws", buffer)
24
23
  )
25
24
  this.awaCharacteristic.readValue()
26
25
  .then((buffer)=>
@@ -30,13 +29,13 @@ class UltrasonicWindMeter extends BTSensor{
30
29
  }
31
30
  async init(){
32
31
  await super.init()
33
- this.addMetadatum("batt","","Battery strength",
34
- (buffer)=>{return buffer.readUInt8()})
35
- this.addMetadatum("awa","","Apparent Wind Angle",
36
- (buffer)=>{return buffer.readInt16LE()}
32
+ this.addMetadatum("batt","ratio","Battery strength",
33
+ (buffer)=>{return (buffer.readUInt8())/100})
34
+ this.addMetadatum("awa","rad","Apparent Wind Angle",
35
+ (buffer)=>{return ((buffer.readInt16LE())/100)*(Math.PI/180)}
37
36
  )
38
- this.addMetadatum("aws","","Apparent Wind Speed",
39
- (buffer)=>{return buffer.readInt16LE()}
37
+ this.addMetadatum("aws","m/s","Apparent Wind Speed",
38
+ (buffer)=>{return (buffer.readInt16LE()/100)*.514444} //convert knots to m/s
40
39
  )
41
40
  }
42
41
 
@@ -85,7 +84,7 @@ class UltrasonicWindMeter extends BTSensor{
85
84
  this.awsCharacteristic=null
86
85
  }
87
86
  if (await this.device.isConnected()){
88
- await this.device.disconnect()
87
+ await this.device.disconnect()
89
88
  }
90
89
  }
91
90
  }