@switchbot/homebridge-switchbot 3.8.2-beta.1 → 3.8.2-beta.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/CHANGELOG.md +2 -1
- package/dist/device/hub.js +2 -2
- package/dist/device/iosensor.js +2 -2
- package/dist/device/meter.js +2 -2
- package/dist/device/meterplus.js +2 -2
- package/dist/types/bledevicestatus.d.ts +4 -4
- package/package.json +4 -4
- package/src/device/hub.ts +2 -2
- package/src/device/iosensor.ts +2 -2
- package/src/device/meter.ts +2 -2
- package/src/device/meterplus.ts +2 -2
- package/src/types/bledevicestatus.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/)
|
|
4
4
|
|
|
5
|
-
## [3.8.2](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v3.8.2) (2024-09-
|
|
5
|
+
## [3.8.2](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v3.8.2) (2024-09-19)
|
|
6
6
|
|
|
7
7
|
### What's Changed
|
|
8
8
|
- Improved macAddress format and finding of invalid formating.
|
|
9
|
+
- Fixed temperature reading issue for Hub 2, Indoor/Outdoor Sensor, Meter, & Meter Plus [#1024](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/1024), Thanks [@azmke](https://github.com/azmke)
|
|
9
10
|
- Housekeeping and updated dependencies.
|
|
10
11
|
|
|
11
12
|
**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v3.8.1...v3.8.2
|
package/dist/device/hub.js
CHANGED
|
@@ -135,10 +135,10 @@ export class Hub extends deviceBase {
|
|
|
135
135
|
}
|
|
136
136
|
async BLEparseStatus() {
|
|
137
137
|
await this.debugLog('BLEparseStatus');
|
|
138
|
-
await this.debugLog(`(temperature, humidity, lightLevel) = BLE:(${this.serviceData.
|
|
138
|
+
await this.debugLog(`(temperature, humidity, lightLevel) = BLE:(${this.serviceData.celsius}, ${this.serviceData.humidity}, ${this.serviceData.lightLevel}), current:(${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity}, ${this.LightSensor?.CurrentAmbientLightLevel})`);
|
|
139
139
|
// CurrentTemperature
|
|
140
140
|
if (!this.device.hub?.hide_temperature && this.TemperatureSensor?.Service) {
|
|
141
|
-
this.TemperatureSensor.CurrentTemperature = this.serviceData.
|
|
141
|
+
this.TemperatureSensor.CurrentTemperature = this.serviceData.celsius;
|
|
142
142
|
await this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}°c`);
|
|
143
143
|
}
|
|
144
144
|
// CurrentRelativeHumidity
|
package/dist/device/iosensor.js
CHANGED
|
@@ -134,7 +134,7 @@ export class IOSensor extends deviceBase {
|
|
|
134
134
|
}
|
|
135
135
|
async BLEparseStatus() {
|
|
136
136
|
await this.debugLog('BLEparseStatus');
|
|
137
|
-
await this.debugLog(`(battery, temperature, humidity) = BLE:(${this.serviceData.battery}, ${this.serviceData.
|
|
137
|
+
await this.debugLog(`(battery, temperature, humidity) = BLE:(${this.serviceData.battery}, ${this.serviceData.celsius}, ${this.serviceData.humidity}), current:(${this.Battery.BatteryLevel}, ${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity})`);
|
|
138
138
|
// BatteryLevel
|
|
139
139
|
this.Battery.BatteryLevel = this.serviceData.battery;
|
|
140
140
|
await this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`);
|
|
@@ -150,7 +150,7 @@ export class IOSensor extends deviceBase {
|
|
|
150
150
|
}
|
|
151
151
|
// Current Temperature
|
|
152
152
|
if (!this.device.meter?.hide_temperature && this.TemperatureSensor?.Service) {
|
|
153
|
-
const CELSIUS = this.serviceData.
|
|
153
|
+
const CELSIUS = this.serviceData.celsius < 0 ? 0 : this.serviceData.celsius > 100 ? 100 : this.serviceData.celsius;
|
|
154
154
|
this.TemperatureSensor.CurrentTemperature = CELSIUS;
|
|
155
155
|
await this.debugLog(`Temperature: ${this.TemperatureSensor.CurrentTemperature}°c`);
|
|
156
156
|
}
|
package/dist/device/meter.js
CHANGED
|
@@ -128,7 +128,7 @@ export class Meter extends deviceBase {
|
|
|
128
128
|
}
|
|
129
129
|
async BLEparseStatus() {
|
|
130
130
|
await this.debugLog('BLEparseStatus');
|
|
131
|
-
await this.debugLog(`(scale, temperature, humidity) = BLE:(${this.serviceData.fahrenheit}, ${this.serviceData.
|
|
131
|
+
await this.debugLog(`(scale, temperature, humidity) = BLE:(${this.serviceData.fahrenheit}, ${this.serviceData.celsius}, ${this.serviceData.humidity}), current:(${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity})`);
|
|
132
132
|
// CurrentRelativeHumidity
|
|
133
133
|
if (!this.device.iosensor?.hide_humidity && this.HumiditySensor?.Service) {
|
|
134
134
|
this.HumiditySensor.CurrentRelativeHumidity = validHumidity(this.serviceData.humidity, 0, 100);
|
|
@@ -136,7 +136,7 @@ export class Meter extends deviceBase {
|
|
|
136
136
|
}
|
|
137
137
|
// Current Temperature
|
|
138
138
|
if (!this.device.meter?.hide_temperature && this.TemperatureSensor?.Service) {
|
|
139
|
-
const CELSIUS = this.serviceData.
|
|
139
|
+
const CELSIUS = this.serviceData.celsius < 0 ? 0 : this.serviceData.celsius > 100 ? 100 : this.serviceData.celsius;
|
|
140
140
|
this.TemperatureSensor.CurrentTemperature = CELSIUS;
|
|
141
141
|
await this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}°c`);
|
|
142
142
|
}
|
package/dist/device/meterplus.js
CHANGED
|
@@ -133,7 +133,7 @@ export class MeterPlus extends deviceBase {
|
|
|
133
133
|
}
|
|
134
134
|
async BLEparseStatus() {
|
|
135
135
|
await this.debugLog('BLEparseStatus');
|
|
136
|
-
await this.debugLog(`(temperature, humidity) = BLE:(${this.serviceData.
|
|
136
|
+
await this.debugLog(`(temperature, humidity) = BLE:(${this.serviceData.celsius}, ${this.serviceData.humidity}), current:(${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity})`);
|
|
137
137
|
// CurrentRelativeHumidity
|
|
138
138
|
if (!this.device.iosensor?.hide_humidity && this.HumiditySensor?.Service) {
|
|
139
139
|
this.HumiditySensor.CurrentRelativeHumidity = validHumidity(this.serviceData.humidity, 0, 100);
|
|
@@ -141,7 +141,7 @@ export class MeterPlus extends deviceBase {
|
|
|
141
141
|
}
|
|
142
142
|
// Current Temperature
|
|
143
143
|
if (!this.device.meter?.hide_temperature && this.TemperatureSensor?.Service) {
|
|
144
|
-
const CELSIUS = this.serviceData.
|
|
144
|
+
const CELSIUS = this.serviceData.celsius < 0 ? 0 : this.serviceData.celsius > 100 ? 100 : this.serviceData.celsius;
|
|
145
145
|
this.TemperatureSensor.CurrentTemperature = CELSIUS;
|
|
146
146
|
await this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}°c`);
|
|
147
147
|
}
|
|
@@ -129,7 +129,7 @@ export type meterServiceData = serviceData & {
|
|
|
129
129
|
model: SwitchBotBLEModel.Meter;
|
|
130
130
|
modelName: SwitchBotBLEModelName.Meter;
|
|
131
131
|
modelFriendlyName: SwitchBotBLEModelFriendlyName.Meter;
|
|
132
|
-
|
|
132
|
+
celsius: number;
|
|
133
133
|
fahrenheit: number;
|
|
134
134
|
fahrenheit_mode: boolean;
|
|
135
135
|
humidity: number;
|
|
@@ -139,7 +139,7 @@ export type meterPlusServiceData = serviceData & {
|
|
|
139
139
|
model: SwitchBotBLEModel.MeterPlus;
|
|
140
140
|
modelName: SwitchBotBLEModelName.MeterPlus;
|
|
141
141
|
modelFriendlyName: SwitchBotBLEModelFriendlyName.MeterPlus;
|
|
142
|
-
|
|
142
|
+
celsius: number;
|
|
143
143
|
fahrenheit: number;
|
|
144
144
|
fahrenheit_mode: boolean;
|
|
145
145
|
humidity: number;
|
|
@@ -149,7 +149,7 @@ export type outdoorMeterServiceData = serviceData & {
|
|
|
149
149
|
model: SwitchBotBLEModel.OutdoorMeter;
|
|
150
150
|
modelName: SwitchBotBLEModelName.OutdoorMeter;
|
|
151
151
|
modelFriendlyName: SwitchBotBLEModelFriendlyName.OutdoorMeter;
|
|
152
|
-
|
|
152
|
+
celsius: number;
|
|
153
153
|
fahrenheit: number;
|
|
154
154
|
fahrenheit_mode: boolean;
|
|
155
155
|
humidity: number;
|
|
@@ -240,7 +240,7 @@ export type hub2ServiceData = serviceData & {
|
|
|
240
240
|
model: SwitchBotBLEModel.Hub2;
|
|
241
241
|
modelName: SwitchBotBLEModelName.Hub2;
|
|
242
242
|
modelFriendlyName: SwitchBotBLEModelFriendlyName.Hub2;
|
|
243
|
-
|
|
243
|
+
celsius: number;
|
|
244
244
|
fahrenheit: number;
|
|
245
245
|
fahrenheit_mode: boolean;
|
|
246
246
|
humidity: number;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@switchbot/homebridge-switchbot",
|
|
3
3
|
"displayName": "SwitchBot",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "3.8.2-beta.
|
|
5
|
+
"version": "3.8.2-beta.3",
|
|
6
6
|
"description": "The SwitchBot plugin allows you to access your SwitchBot device(s) from HomeKit.",
|
|
7
7
|
"author": "SwitchBot <support@wondertechlabs.com> (https://github.com/SwitchBot)",
|
|
8
8
|
"contributors": [
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"undici": "^6.19.8"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@antfu/eslint-config": "^3.6.
|
|
89
|
+
"@antfu/eslint-config": "^3.6.2",
|
|
90
90
|
"@types/aes-js": "^3.1.4",
|
|
91
91
|
"@types/debug": "^4.1.12",
|
|
92
92
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
"homebridge": "^1.8.4",
|
|
102
102
|
"homebridge-config-ui-x": "4.58.0",
|
|
103
103
|
"jest": "^29.7.0",
|
|
104
|
-
"nodemon": "^3.1.
|
|
105
|
-
"npm-check-updates": "^17.1.
|
|
104
|
+
"nodemon": "^3.1.6",
|
|
105
|
+
"npm-check-updates": "^17.1.2",
|
|
106
106
|
"shx": "^0.3.4",
|
|
107
107
|
"ts-node": "^10.9.2",
|
|
108
108
|
"typedoc": "^0.26.7",
|
package/src/device/hub.ts
CHANGED
|
@@ -178,11 +178,11 @@ export class Hub extends deviceBase {
|
|
|
178
178
|
|
|
179
179
|
async BLEparseStatus(): Promise<void> {
|
|
180
180
|
await this.debugLog('BLEparseStatus')
|
|
181
|
-
await this.debugLog(`(temperature, humidity, lightLevel) = BLE:(${this.serviceData.
|
|
181
|
+
await this.debugLog(`(temperature, humidity, lightLevel) = BLE:(${this.serviceData.celsius}, ${this.serviceData.humidity}, ${this.serviceData.lightLevel}), current:(${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity}, ${this.LightSensor?.CurrentAmbientLightLevel})`)
|
|
182
182
|
|
|
183
183
|
// CurrentTemperature
|
|
184
184
|
if (!this.device.hub?.hide_temperature && this.TemperatureSensor?.Service) {
|
|
185
|
-
this.TemperatureSensor.CurrentTemperature = this.serviceData.
|
|
185
|
+
this.TemperatureSensor.CurrentTemperature = this.serviceData.celsius
|
|
186
186
|
await this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}°c`)
|
|
187
187
|
}
|
|
188
188
|
|
package/src/device/iosensor.ts
CHANGED
|
@@ -180,7 +180,7 @@ export class IOSensor extends deviceBase {
|
|
|
180
180
|
|
|
181
181
|
async BLEparseStatus(): Promise<void> {
|
|
182
182
|
await this.debugLog('BLEparseStatus')
|
|
183
|
-
await this.debugLog(`(battery, temperature, humidity) = BLE:(${this.serviceData.battery}, ${this.serviceData.
|
|
183
|
+
await this.debugLog(`(battery, temperature, humidity) = BLE:(${this.serviceData.battery}, ${this.serviceData.celsius}, ${this.serviceData.humidity}), current:(${this.Battery.BatteryLevel}, ${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity})`)
|
|
184
184
|
|
|
185
185
|
// BatteryLevel
|
|
186
186
|
this.Battery.BatteryLevel = this.serviceData.battery
|
|
@@ -200,7 +200,7 @@ export class IOSensor extends deviceBase {
|
|
|
200
200
|
|
|
201
201
|
// Current Temperature
|
|
202
202
|
if (!this.device.meter?.hide_temperature && this.TemperatureSensor?.Service) {
|
|
203
|
-
const CELSIUS = this.serviceData.
|
|
203
|
+
const CELSIUS = this.serviceData.celsius < 0 ? 0 : this.serviceData.celsius > 100 ? 100 : this.serviceData.celsius
|
|
204
204
|
this.TemperatureSensor.CurrentTemperature = CELSIUS
|
|
205
205
|
await this.debugLog(`Temperature: ${this.TemperatureSensor.CurrentTemperature}°c`)
|
|
206
206
|
}
|
package/src/device/meter.ts
CHANGED
|
@@ -173,7 +173,7 @@ export class Meter extends deviceBase {
|
|
|
173
173
|
|
|
174
174
|
async BLEparseStatus(): Promise<void> {
|
|
175
175
|
await this.debugLog('BLEparseStatus')
|
|
176
|
-
await this.debugLog(`(scale, temperature, humidity) = BLE:(${this.serviceData.fahrenheit}, ${this.serviceData.
|
|
176
|
+
await this.debugLog(`(scale, temperature, humidity) = BLE:(${this.serviceData.fahrenheit}, ${this.serviceData.celsius}, ${this.serviceData.humidity}), current:(${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity})`)
|
|
177
177
|
|
|
178
178
|
// CurrentRelativeHumidity
|
|
179
179
|
if (!this.device.iosensor?.hide_humidity && this.HumiditySensor?.Service) {
|
|
@@ -183,7 +183,7 @@ export class Meter extends deviceBase {
|
|
|
183
183
|
|
|
184
184
|
// Current Temperature
|
|
185
185
|
if (!this.device.meter?.hide_temperature && this.TemperatureSensor?.Service) {
|
|
186
|
-
const CELSIUS = this.serviceData.
|
|
186
|
+
const CELSIUS = this.serviceData.celsius < 0 ? 0 : this.serviceData.celsius > 100 ? 100 : this.serviceData.celsius
|
|
187
187
|
this.TemperatureSensor.CurrentTemperature = CELSIUS
|
|
188
188
|
await this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}°c`)
|
|
189
189
|
}
|
package/src/device/meterplus.ts
CHANGED
|
@@ -178,7 +178,7 @@ export class MeterPlus extends deviceBase {
|
|
|
178
178
|
|
|
179
179
|
async BLEparseStatus(): Promise<void> {
|
|
180
180
|
await this.debugLog('BLEparseStatus')
|
|
181
|
-
await this.debugLog(`(temperature, humidity) = BLE:(${this.serviceData.
|
|
181
|
+
await this.debugLog(`(temperature, humidity) = BLE:(${this.serviceData.celsius}, ${this.serviceData.humidity}), current:(${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity})`)
|
|
182
182
|
|
|
183
183
|
// CurrentRelativeHumidity
|
|
184
184
|
if (!this.device.iosensor?.hide_humidity && this.HumiditySensor?.Service) {
|
|
@@ -187,7 +187,7 @@ export class MeterPlus extends deviceBase {
|
|
|
187
187
|
}
|
|
188
188
|
// Current Temperature
|
|
189
189
|
if (!this.device.meter?.hide_temperature && this.TemperatureSensor?.Service) {
|
|
190
|
-
const CELSIUS = this.serviceData.
|
|
190
|
+
const CELSIUS = this.serviceData.celsius < 0 ? 0 : this.serviceData.celsius > 100 ? 100 : this.serviceData.celsius
|
|
191
191
|
this.TemperatureSensor.CurrentTemperature = CELSIUS
|
|
192
192
|
await this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}°c`)
|
|
193
193
|
}
|
|
@@ -140,7 +140,7 @@ export type meterServiceData = serviceData & {
|
|
|
140
140
|
model: SwitchBotBLEModel.Meter
|
|
141
141
|
modelName: SwitchBotBLEModelName.Meter
|
|
142
142
|
modelFriendlyName: SwitchBotBLEModelFriendlyName.Meter
|
|
143
|
-
|
|
143
|
+
celsius: number
|
|
144
144
|
fahrenheit: number
|
|
145
145
|
fahrenheit_mode: boolean
|
|
146
146
|
humidity: number
|
|
@@ -151,7 +151,7 @@ export type meterPlusServiceData = serviceData & {
|
|
|
151
151
|
model: SwitchBotBLEModel.MeterPlus
|
|
152
152
|
modelName: SwitchBotBLEModelName.MeterPlus
|
|
153
153
|
modelFriendlyName: SwitchBotBLEModelFriendlyName.MeterPlus
|
|
154
|
-
|
|
154
|
+
celsius: number
|
|
155
155
|
fahrenheit: number
|
|
156
156
|
fahrenheit_mode: boolean
|
|
157
157
|
humidity: number
|
|
@@ -162,7 +162,7 @@ export type outdoorMeterServiceData = serviceData & {
|
|
|
162
162
|
model: SwitchBotBLEModel.OutdoorMeter
|
|
163
163
|
modelName: SwitchBotBLEModelName.OutdoorMeter
|
|
164
164
|
modelFriendlyName: SwitchBotBLEModelFriendlyName.OutdoorMeter
|
|
165
|
-
|
|
165
|
+
celsius: number
|
|
166
166
|
fahrenheit: number
|
|
167
167
|
fahrenheit_mode: boolean
|
|
168
168
|
humidity: number
|
|
@@ -260,7 +260,7 @@ export type hub2ServiceData = serviceData & {
|
|
|
260
260
|
model: SwitchBotBLEModel.Hub2
|
|
261
261
|
modelName: SwitchBotBLEModelName.Hub2
|
|
262
262
|
modelFriendlyName: SwitchBotBLEModelFriendlyName.Hub2
|
|
263
|
-
|
|
263
|
+
celsius: number
|
|
264
264
|
fahrenheit: number
|
|
265
265
|
fahrenheit_mode: boolean
|
|
266
266
|
humidity: number
|