homebridge-solaxcloud-api 2.3.3 → 2.4.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 +140 -131
- package/LICENSE +175 -175
- package/config.sample +15 -15
- package/config.schema.json +105 -105
- package/dist/batteryAccessory.d.ts +70 -70
- package/dist/batteryAccessory.d.ts.map +1 -1
- package/dist/batteryAccessory.js +124 -123
- package/dist/batteryAccessory.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -6
- package/dist/lightSensorAccessory.d.ts +34 -34
- package/dist/lightSensorAccessory.js +58 -58
- package/dist/motionAccessory.d.ts +53 -53
- package/dist/motionAccessory.js +93 -93
- package/dist/outletAccessory.d.ts +100 -100
- package/dist/outletAccessory.js +187 -187
- package/dist/platform.d.ts +62 -56
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +294 -265
- package/dist/platform.js.map +1 -1
- package/dist/platformAccessory.d.ts +70 -70
- package/dist/platformAccessory.js +102 -102
- package/dist/platformInverter.d.ts +180 -176
- package/dist/platformInverter.d.ts.map +1 -1
- package/dist/platformInverter.js +348 -343
- package/dist/platformInverter.js.map +1 -1
- package/dist/platformMeters.d.ts +68 -68
- package/dist/platformMeters.js +2 -2
- package/dist/settings.d.ts +8 -8
- package/dist/settings.js +11 -11
- package/dist/solaxcloudfetch.d.ts +1 -1
- package/dist/solaxcloudfetch.js +21 -21
- package/dist/solaxcloudfetch.js.map +1 -1
- package/dist/statistics.d.ts +36 -36
- package/dist/statistics.js +88 -88
- package/dist/util.d.ts +23 -23
- package/dist/util.js +42 -42
- package/package.json +55 -54
- package/config.json +0 -16
- package/dist/solaxcloudapi.d.ts +0 -163
- package/dist/solaxcloudapi.d.ts.map +0 -1
- package/dist/solaxcloudapi.js +0 -226
- package/dist/solaxcloudapi.js.map +0 -1
- package/test/solaxcloudapi.test.ts +0 -164
package/dist/platform.d.ts
CHANGED
|
@@ -1,57 +1,63 @@
|
|
|
1
|
-
import { AccessoryPlugin, API, StaticPlatformPlugin, Logging, PlatformConfig } from 'homebridge';
|
|
2
|
-
/**
|
|
3
|
-
* SolaxCloudAPIPlatform.
|
|
4
|
-
* This class is the main constructor for your plugin, this is where you should
|
|
5
|
-
* parse the user config and discover/register accessories with Homebridge.
|
|
6
|
-
*/
|
|
7
|
-
export declare class SolaxCloudAPIPlatform implements StaticPlatformPlugin {
|
|
8
|
-
private readonly log;
|
|
9
|
-
private readonly config;
|
|
10
|
-
private readonly api;
|
|
11
|
-
/**
|
|
12
|
-
* Number of periods to use for data smoothing.
|
|
13
|
-
*/
|
|
14
|
-
private smoothingWindow;
|
|
15
|
-
/**
|
|
16
|
-
* Array of inverters.
|
|
17
|
-
*/
|
|
18
|
-
private inverters;
|
|
19
|
-
/**
|
|
20
|
-
* Inverter totalizer.
|
|
21
|
-
**/
|
|
22
|
-
private allInverters;
|
|
23
|
-
/**
|
|
24
|
-
* Platform constructor.
|
|
25
|
-
* @param log
|
|
26
|
-
* @param config
|
|
27
|
-
* @param api
|
|
28
|
-
* @returns
|
|
29
|
-
*/
|
|
30
|
-
constructor(log: Logging, config: PlatformConfig, api: API);
|
|
31
|
-
/**
|
|
32
|
-
* Check whether object implements interface InverterConfig and brand has a valid entry.
|
|
33
|
-
* @param obj Any object.
|
|
34
|
-
* @returns Whether object implements interface InverterConfig.
|
|
35
|
-
*/
|
|
36
|
-
private static isInverterConfig;
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
import { AccessoryPlugin, API, StaticPlatformPlugin, Logging, PlatformConfig } from 'homebridge';
|
|
2
|
+
/**
|
|
3
|
+
* SolaxCloudAPIPlatform.
|
|
4
|
+
* This class is the main constructor for your plugin, this is where you should
|
|
5
|
+
* parse the user config and discover/register accessories with Homebridge.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SolaxCloudAPIPlatform implements StaticPlatformPlugin {
|
|
8
|
+
private readonly log;
|
|
9
|
+
private readonly config;
|
|
10
|
+
private readonly api;
|
|
11
|
+
/**
|
|
12
|
+
* Number of periods to use for data smoothing.
|
|
13
|
+
*/
|
|
14
|
+
private smoothingWindow;
|
|
15
|
+
/**
|
|
16
|
+
* Array of inverters.
|
|
17
|
+
*/
|
|
18
|
+
private inverters;
|
|
19
|
+
/**
|
|
20
|
+
* Inverter totalizer.
|
|
21
|
+
**/
|
|
22
|
+
private allInverters;
|
|
23
|
+
/**
|
|
24
|
+
* Platform constructor.
|
|
25
|
+
* @param log
|
|
26
|
+
* @param config
|
|
27
|
+
* @param api
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
constructor(log: Logging, config: PlatformConfig, api: API);
|
|
31
|
+
/**
|
|
32
|
+
* Check whether object implements interface InverterConfig and brand has a valid entry.
|
|
33
|
+
* @param obj Any object.
|
|
34
|
+
* @returns Whether object implements interface InverterConfig.
|
|
35
|
+
*/
|
|
36
|
+
private static isInverterConfig;
|
|
37
|
+
/**
|
|
38
|
+
* Gets an inverter brand display name from config.
|
|
39
|
+
* @param brand Inverter brand from config.
|
|
40
|
+
* @returns Inverter brand display name.
|
|
41
|
+
*/
|
|
42
|
+
private static getInverterBrandDisplayName;
|
|
43
|
+
/**
|
|
44
|
+
* Update data for virtual inverter totalizer based on individual inverter data.
|
|
45
|
+
*/
|
|
46
|
+
private updateAllInvertersData;
|
|
47
|
+
/**
|
|
48
|
+
* Sleeps for a number of milliseconds.
|
|
49
|
+
* @param millis {number} The number of milliseconds to sleep.
|
|
50
|
+
*/
|
|
51
|
+
private sleep;
|
|
52
|
+
/**
|
|
53
|
+
* Periodically retrieves inverter data from Solax Cloud API using configured tokenID and SN.
|
|
54
|
+
*/
|
|
55
|
+
private fetchDataPeriodically;
|
|
56
|
+
/**
|
|
57
|
+
* Checks platform config validity and sets defaults whenever needed.
|
|
58
|
+
* @returns {boolean} Whether the config is valid.
|
|
59
|
+
*/
|
|
60
|
+
private checkConfig;
|
|
61
|
+
accessories(callback: (foundAccessories: AccessoryPlugin[]) => void): void;
|
|
62
|
+
}
|
|
57
63
|
//# sourceMappingURL=platform.d.ts.map
|
package/dist/platform.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,oBAAoB,EAAE,OAAO,EAAE,cAAc,EAAY,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,oBAAoB,EAAE,OAAO,EAAE,cAAc,EAAY,MAAM,YAAY,CAAC;AAuD3G;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,oBAAoB;IAChE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;IAE1B;;OAEG;IACH,OAAO,CAAC,eAAe,CAAK;IAE5B;;OAEG;IACH,OAAO,CAAC,SAAS,CAAuC;IAExD;;QAEI;IACJ,OAAO,CAAC,YAAY,CAAiC;IAErD;;;;;;OAMG;gBACU,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG;IA4D3D;;;;OAIG;IAEH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAI/B;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,2BAA2B;IAW1C;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAmC9B;;;OAGG;YACW,KAAK;IAInB;;OAEG;YACW,qBAAqB;IAoBnC;;;OAGG;IACH,OAAO,CAAC,WAAW;IAkHnB,WAAW,CAAC,QAAQ,EAAE,CAAC,gBAAgB,EAAE,eAAe,EAAE,KAAK,IAAI,GAAG,IAAI;CAa3E"}
|