@switchbot/homebridge-switchbot 1.7.1-beta.6 → 1.8.0
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 +5 -1
- package/config.schema.json +49 -36
- package/dist/devices/bots.d.ts +4 -3
- package/dist/devices/bots.d.ts.map +1 -1
- package/dist/devices/bots.js +42 -33
- package/dist/devices/bots.js.map +1 -1
- package/dist/devices/colorbulb.d.ts +4 -3
- package/dist/devices/colorbulb.d.ts.map +1 -1
- package/dist/devices/colorbulb.js +38 -29
- package/dist/devices/colorbulb.js.map +1 -1
- package/dist/devices/contact.d.ts +4 -3
- package/dist/devices/contact.d.ts.map +1 -1
- package/dist/devices/contact.js +42 -34
- package/dist/devices/contact.js.map +1 -1
- package/dist/devices/curtains.d.ts +2 -1
- package/dist/devices/curtains.d.ts.map +1 -1
- package/dist/devices/curtains.js +24 -10
- package/dist/devices/curtains.js.map +1 -1
- package/dist/devices/humidifiers.d.ts +1 -0
- package/dist/devices/humidifiers.d.ts.map +1 -1
- package/dist/devices/humidifiers.js +20 -1
- package/dist/devices/humidifiers.js.map +1 -1
- package/dist/devices/meters.d.ts +4 -3
- package/dist/devices/meters.d.ts.map +1 -1
- package/dist/devices/meters.js +46 -34
- package/dist/devices/meters.js.map +1 -1
- package/dist/devices/motion.d.ts +4 -3
- package/dist/devices/motion.d.ts.map +1 -1
- package/dist/devices/motion.js +42 -30
- package/dist/devices/motion.js.map +1 -1
- package/dist/devices/plugs.d.ts +4 -3
- package/dist/devices/plugs.d.ts.map +1 -1
- package/dist/devices/plugs.js +42 -30
- package/dist/devices/plugs.js.map +1 -1
- package/dist/irdevices/airconditioners.d.ts +2 -1
- package/dist/irdevices/airconditioners.d.ts.map +1 -1
- package/dist/irdevices/airconditioners.js +19 -12
- package/dist/irdevices/airconditioners.js.map +1 -1
- package/dist/irdevices/airpurifiers.d.ts +4 -3
- package/dist/irdevices/airpurifiers.d.ts.map +1 -1
- package/dist/irdevices/airpurifiers.js +23 -16
- package/dist/irdevices/airpurifiers.js.map +1 -1
- package/dist/irdevices/cameras.d.ts +2 -1
- package/dist/irdevices/cameras.d.ts.map +1 -1
- package/dist/irdevices/cameras.js +19 -12
- package/dist/irdevices/cameras.js.map +1 -1
- package/dist/irdevices/fans.d.ts +2 -1
- package/dist/irdevices/fans.d.ts.map +1 -1
- package/dist/irdevices/fans.js +19 -12
- package/dist/irdevices/fans.js.map +1 -1
- package/dist/irdevices/lights.d.ts +2 -1
- package/dist/irdevices/lights.d.ts.map +1 -1
- package/dist/irdevices/lights.js +19 -12
- package/dist/irdevices/lights.js.map +1 -1
- package/dist/irdevices/others.d.ts +3 -2
- package/dist/irdevices/others.d.ts.map +1 -1
- package/dist/irdevices/others.js +23 -16
- package/dist/irdevices/others.js.map +1 -1
- package/dist/irdevices/tvs.d.ts +2 -1
- package/dist/irdevices/tvs.d.ts.map +1 -1
- package/dist/irdevices/tvs.js +19 -12
- package/dist/irdevices/tvs.js.map +1 -1
- package/dist/irdevices/vacuumcleaners.d.ts +2 -1
- package/dist/irdevices/vacuumcleaners.d.ts.map +1 -1
- package/dist/irdevices/vacuumcleaners.js +19 -12
- package/dist/irdevices/vacuumcleaners.js.map +1 -1
- package/dist/irdevices/waterheaters.d.ts +2 -1
- package/dist/irdevices/waterheaters.d.ts.map +1 -1
- package/dist/irdevices/waterheaters.js +19 -12
- package/dist/irdevices/waterheaters.js.map +1 -1
- package/dist/settings.d.ts +7 -1
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/package.json +71 -71
- package/src/devices/bots.ts +43 -35
- package/src/devices/colorbulb.ts +39 -31
- package/src/devices/contact.ts +43 -35
- package/src/devices/curtains.ts +26 -12
- package/src/devices/humidifiers.ts +21 -1
- package/src/devices/meters.ts +47 -34
- package/src/devices/motion.ts +43 -30
- package/src/devices/plugs.ts +43 -30
- package/src/irdevices/airconditioners.ts +20 -12
- package/src/irdevices/airpurifiers.ts +24 -16
- package/src/irdevices/cameras.ts +20 -12
- package/src/irdevices/fans.ts +20 -12
- package/src/irdevices/lights.ts +20 -12
- package/src/irdevices/others.ts +24 -16
- package/src/irdevices/tvs.ts +20 -12
- package/src/irdevices/vacuumcleaners.ts +20 -12
- package/src/irdevices/waterheaters.ts +20 -12
- package/src/settings.ts +7 -1
package/src/irdevices/others.ts
CHANGED
|
@@ -26,8 +26,9 @@ export class Others {
|
|
|
26
26
|
public device: irdevice & irDevicesConfig,
|
|
27
27
|
) {
|
|
28
28
|
// default placeholders
|
|
29
|
-
this.logs();
|
|
30
|
-
this.deviceType();
|
|
29
|
+
this.logs(device);
|
|
30
|
+
this.deviceType(device);
|
|
31
|
+
this.config(device);
|
|
31
32
|
if (this.Active === undefined) {
|
|
32
33
|
this.Active = this.platform.Characteristic.Active.INACTIVE;
|
|
33
34
|
} else {
|
|
@@ -65,9 +66,9 @@ export class Others {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
deviceType() {
|
|
69
|
-
if (
|
|
70
|
-
this.otherDeviceType = this.accessory.context.deviceType =
|
|
69
|
+
deviceType(device: irdevice & irDevicesConfig) {
|
|
70
|
+
if (device.other?.deviceType) {
|
|
71
|
+
this.otherDeviceType = this.accessory.context.deviceType = device.other.deviceType;
|
|
71
72
|
if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
|
|
72
73
|
this.warnLog(`Other: ${this.accessory.displayName} Using Device Type: ${this.otherDeviceType}`);
|
|
73
74
|
}
|
|
@@ -76,22 +77,29 @@ export class Others {
|
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
|
|
80
|
+
config(device: irdevice & irDevicesConfig) {
|
|
81
|
+
const config: any = device.other;
|
|
82
|
+
if (device.logging !== undefined) {
|
|
83
|
+
config['logging'] = device.logging;
|
|
84
|
+
}
|
|
85
|
+
if (config !== undefined) {
|
|
86
|
+
this.warnLog(`Other: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
logs(device: irdevice & irDevicesConfig) {
|
|
80
91
|
if (this.platform.debugMode) {
|
|
81
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
82
|
-
this.
|
|
83
|
-
} else if (
|
|
84
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
85
|
-
|
|
86
|
-
this.warnLog(`Other: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
87
|
-
}
|
|
92
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
93
|
+
this.debugLog(`Other: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
94
|
+
} else if (device.logging) {
|
|
95
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
96
|
+
this.debugLog(`Other: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
88
97
|
} else if (this.platform.config.options?.logging) {
|
|
89
98
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
90
|
-
|
|
91
|
-
this.warnLog(`Other: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
92
|
-
}
|
|
99
|
+
this.debugLog(`Other: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
93
100
|
} else {
|
|
94
101
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
102
|
+
this.debugLog(`Other: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
95
103
|
}
|
|
96
104
|
}
|
|
97
105
|
|
package/src/irdevices/tvs.ts
CHANGED
|
@@ -30,7 +30,8 @@ export class TV {
|
|
|
30
30
|
public device: irdevice & irDevicesConfig,
|
|
31
31
|
) {
|
|
32
32
|
// default placeholders
|
|
33
|
-
this.logs();
|
|
33
|
+
this.logs(device);
|
|
34
|
+
this.config(device);
|
|
34
35
|
if (this.Active === undefined) {
|
|
35
36
|
this.Active = this.platform.Characteristic.Active.INACTIVE;
|
|
36
37
|
} else {
|
|
@@ -128,22 +129,29 @@ export class TV {
|
|
|
128
129
|
.onSet(this.VolumeSelectorSet.bind(this));
|
|
129
130
|
}
|
|
130
131
|
|
|
131
|
-
|
|
132
|
+
config(device: irdevice & irDevicesConfig) {
|
|
133
|
+
const config: any = device.irtv;
|
|
134
|
+
if (device.logging !== undefined) {
|
|
135
|
+
config['logging'] = device.logging;
|
|
136
|
+
}
|
|
137
|
+
if (config !== undefined) {
|
|
138
|
+
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
logs(device: irdevice & irDevicesConfig) {
|
|
132
143
|
if (this.platform.debugMode) {
|
|
133
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
134
|
-
this.
|
|
135
|
-
} else if (
|
|
136
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
137
|
-
|
|
138
|
-
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
139
|
-
}
|
|
144
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
145
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
146
|
+
} else if (device.logging) {
|
|
147
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
148
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
140
149
|
} else if (this.platform.config.options?.logging) {
|
|
141
150
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
142
|
-
|
|
143
|
-
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
144
|
-
}
|
|
151
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
145
152
|
} else {
|
|
146
153
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
154
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
147
155
|
}
|
|
148
156
|
}
|
|
149
157
|
|
|
@@ -25,7 +25,8 @@ export class VacuumCleaner {
|
|
|
25
25
|
public device: irdevice & irDevicesConfig,
|
|
26
26
|
) {
|
|
27
27
|
// default placeholders
|
|
28
|
-
this.logs();
|
|
28
|
+
this.logs(device);
|
|
29
|
+
this.config(device);
|
|
29
30
|
if (this.On === undefined) {
|
|
30
31
|
this.On = false;
|
|
31
32
|
} else {
|
|
@@ -57,22 +58,29 @@ export class VacuumCleaner {
|
|
|
57
58
|
this.service.getCharacteristic(this.platform.Characteristic.On).onSet(this.OnSet.bind(this));
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
config(device: irdevice & irDevicesConfig) {
|
|
62
|
+
const config: any = device.irvc;
|
|
63
|
+
if (device.logging !== undefined) {
|
|
64
|
+
config['logging'] = device.logging;
|
|
65
|
+
}
|
|
66
|
+
if (config !== undefined) {
|
|
67
|
+
this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
logs(device: irdevice & irDevicesConfig) {
|
|
61
72
|
if (this.platform.debugMode) {
|
|
62
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
63
|
-
this.
|
|
64
|
-
} else if (
|
|
65
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
66
|
-
|
|
67
|
-
this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
68
|
-
}
|
|
73
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
74
|
+
this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
75
|
+
} else if (device.logging) {
|
|
76
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
77
|
+
this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
69
78
|
} else if (this.platform.config.options?.logging) {
|
|
70
79
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
71
|
-
|
|
72
|
-
this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
73
|
-
}
|
|
80
|
+
this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
74
81
|
} else {
|
|
75
82
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
83
|
+
this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
76
84
|
}
|
|
77
85
|
}
|
|
78
86
|
|
|
@@ -25,7 +25,8 @@ export class WaterHeater {
|
|
|
25
25
|
public device: irdevice & irDevicesConfig,
|
|
26
26
|
) {
|
|
27
27
|
// default placeholders
|
|
28
|
-
this.logs();
|
|
28
|
+
this.logs(device);
|
|
29
|
+
this.config(device);
|
|
29
30
|
if (this.Active === undefined) {
|
|
30
31
|
this.Active = this.platform.Characteristic.Active.INACTIVE;
|
|
31
32
|
} else {
|
|
@@ -66,22 +67,29 @@ export class WaterHeater {
|
|
|
66
67
|
this.service.getCharacteristic(this.platform.Characteristic.Active).onSet(this.ActiveSet.bind(this));
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
config(device: irdevice & irDevicesConfig) {
|
|
71
|
+
const config: any = device.irwh;
|
|
72
|
+
if (device.logging !== undefined) {
|
|
73
|
+
config['logging'] = device.logging;
|
|
74
|
+
}
|
|
75
|
+
if (config !== undefined) {
|
|
76
|
+
this.warnLog(`Water Heater: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
logs(device: irdevice & irDevicesConfig) {
|
|
70
81
|
if (this.platform.debugMode) {
|
|
71
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
72
|
-
this.
|
|
73
|
-
} else if (
|
|
74
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
75
|
-
|
|
76
|
-
this.warnLog(`Water Heater: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
77
|
-
}
|
|
82
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
83
|
+
this.debugLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
84
|
+
} else if (device.logging) {
|
|
85
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
86
|
+
this.debugLog(`Water Heater: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
78
87
|
} else if (this.platform.config.options?.logging) {
|
|
79
88
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
80
|
-
|
|
81
|
-
this.warnLog(`Water Heater: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
82
|
-
}
|
|
89
|
+
this.debugLog(`Water Heater: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
83
90
|
} else {
|
|
84
91
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
92
|
+
this.debugLog(`Water Heater: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
85
93
|
}
|
|
86
94
|
}
|
|
87
95
|
|
package/src/settings.ts
CHANGED
|
@@ -50,6 +50,7 @@ export interface devicesConfig extends device {
|
|
|
50
50
|
contact?: contact;
|
|
51
51
|
motion?: motion;
|
|
52
52
|
colorbulb?: colorbulb;
|
|
53
|
+
plug?: Record<any, any>;
|
|
53
54
|
ble?: string;
|
|
54
55
|
scanDuration?: number;
|
|
55
56
|
hide_device?: boolean;
|
|
@@ -77,7 +78,7 @@ export type curtain = {
|
|
|
77
78
|
hide_lightsensor?: boolean;
|
|
78
79
|
set_minLux?: number;
|
|
79
80
|
set_maxLux?: number;
|
|
80
|
-
|
|
81
|
+
updateRate?: number;
|
|
81
82
|
set_max?: number;
|
|
82
83
|
set_min?: number;
|
|
83
84
|
set_minStep?: number;
|
|
@@ -107,6 +108,11 @@ export interface irDevicesConfig extends irdevice {
|
|
|
107
108
|
logging?: string;
|
|
108
109
|
irfan?: irfan;
|
|
109
110
|
irair?: irair;
|
|
111
|
+
irpur?: Record<any, any>;
|
|
112
|
+
ircam?: Record<any, any>;
|
|
113
|
+
irlight?: Record<any, any>;
|
|
114
|
+
irvc?: Record<any, any>;
|
|
115
|
+
irwh?: Record<any, any>;
|
|
110
116
|
irtv?: irtv;
|
|
111
117
|
other?: other;
|
|
112
118
|
hide_device?: boolean;
|