@mega-yfue/eufy-sdk 0.2.0-beta.16 → 0.2.0-beta.18
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/dist/core/solix-types.d.ts +79 -0
- package/dist/index.js +662 -35
- package/dist/index.js.map +4 -4
- package/dist/model/capabilities/solix.d.ts +114 -16
- package/dist/model/index.d.ts +3 -1
- package/dist/model/solix-catalog.d.ts +5 -0
- package/dist/model/solix-device.d.ts +35 -1
- package/dist/model/solix-family.d.ts +31 -0
- package/dist/model/solix-site.d.ts +70 -0
- package/dist/transport/http/solix-client.d.ts +109 -3
- package/dist/transport/http/solix-constants.d.ts +27 -0
- package/dist/transport/mqtt/solix-mqtt.d.ts +123 -16
- package/dist/transport/mqtt/topics.d.ts +13 -3
- package/package.json +1 -1
|
@@ -18,6 +18,34 @@ export interface SolixDeviceRecord {
|
|
|
18
18
|
rssi?: string | number;
|
|
19
19
|
[k: string]: unknown;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* One battery discharge-cutoff (minimum-SOC) preset, as returned by
|
|
23
|
+
* `SolixClient.getPowerCutoff()`. `output_cutoff_data` is the minimum state-of-charge percent the
|
|
24
|
+
* option enforces; `id` is what `setPowerCutoff()` takes; `is_selected` (1) marks the current one.
|
|
25
|
+
*/
|
|
26
|
+
export interface SolixPowerCutoffOption {
|
|
27
|
+
id: number;
|
|
28
|
+
output_cutoff_data: number;
|
|
29
|
+
is_selected?: number;
|
|
30
|
+
[k: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The Solarbank's battery SOC-limit settings — the `param_data` block read from / written to
|
|
34
|
+
* `site/get_site_device_param` under `param_type "27"` (verified live on an AE103). All values are
|
|
35
|
+
* whole-percent integers. `chargeUpperLimit` caps charging (the app's "charge limit" / max SOC) and
|
|
36
|
+
* `dischargeLowerLimit` floors discharging (the "discharge limit" / minimum SOC — the same quantity the
|
|
37
|
+
* realtime `b5` telemetry blob reports). `backupReserve` (+ its switch) is the reserved-for-outage SOC;
|
|
38
|
+
* `socCalibrationEnable` is the periodic full-cycle calibration toggle. The wire keys are the
|
|
39
|
+
* snake_case form (`charge_upper_limit`, `discharge_lower_limit`, `backup_reserve`,
|
|
40
|
+
* `backup_reserve_switch`, `soc_calibration_enable`).
|
|
41
|
+
*/
|
|
42
|
+
export interface SolixSocParams {
|
|
43
|
+
chargeUpperLimit: number;
|
|
44
|
+
dischargeLowerLimit: number;
|
|
45
|
+
backupReserve: number;
|
|
46
|
+
backupReserveSwitch: number;
|
|
47
|
+
socCalibrationEnable: number;
|
|
48
|
+
}
|
|
21
49
|
/** One product in the pairable-product catalog. Extra vendor fields (images, guides) are preserved. */
|
|
22
50
|
export interface SolixProduct {
|
|
23
51
|
/** SKU / model code, e.g. `A1782`. */
|
|
@@ -34,3 +62,54 @@ export interface SolixProductCategory {
|
|
|
34
62
|
products: SolixProduct[];
|
|
35
63
|
[k: string]: unknown;
|
|
36
64
|
}
|
|
65
|
+
/** One device's membership entry within a site, as carried by `get_site_list`'s `site_device_list`. */
|
|
66
|
+
export interface SolixSiteDeviceEntry {
|
|
67
|
+
device_sn: string;
|
|
68
|
+
/** The device's product/model code (the site list names this field `device_model`). */
|
|
69
|
+
device_model: string;
|
|
70
|
+
device_name?: string;
|
|
71
|
+
/** Anker device-type discriminator (e.g. 3 = Solarbank/battery, 6 = smart meter). */
|
|
72
|
+
device_type?: number;
|
|
73
|
+
[k: string]: unknown;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A site ("system") record, as returned by `SolixClient.getSites()`. A site is the account's home
|
|
77
|
+
* energy system — the "My Home" the app shows — grouping the member devices ({@link site_device_list})
|
|
78
|
+
* that a {@link SolixSiteReader} resolves into a `SolixSite`. Extra vendor fields are preserved.
|
|
79
|
+
*/
|
|
80
|
+
export interface SolixSiteRecord {
|
|
81
|
+
site_id: string;
|
|
82
|
+
site_name?: string;
|
|
83
|
+
/** Anker's site-type discriminator (e.g. 20 for a Solarbank-anchored home system). */
|
|
84
|
+
power_site_type?: number;
|
|
85
|
+
site_device_list?: SolixSiteDeviceEntry[];
|
|
86
|
+
[k: string]: unknown;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* One Solarbank/battery entry inside a site "scene" snapshot ({@link SolixSiteScene}). The scene mirrors
|
|
90
|
+
* the app's dashboard read: values arrive as STRINGS. Only the fields this SDK actually consumes are
|
|
91
|
+
* typed (chiefly `bat_temperature`, the realtime `ff09` push doesn't reliably carry); the index signature
|
|
92
|
+
* preserves the rest (`bat_charge_power`, `charging_status`, `load_port_*`, `function_switch`, …) verbatim.
|
|
93
|
+
*/
|
|
94
|
+
export interface SolixSceneSolarbank {
|
|
95
|
+
device_sn?: string;
|
|
96
|
+
device_pn?: string;
|
|
97
|
+
/** Battery pack temperature in °C (string on the wire). The scene is the reliable source for this. */
|
|
98
|
+
bat_temperature?: string | number;
|
|
99
|
+
/** State of charge, % (string on the wire). Cross-checks the `ff09` `0xa3` SOC. */
|
|
100
|
+
bat_soc?: string | number;
|
|
101
|
+
[k: string]: unknown;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A site "scene" snapshot from {@link SolixClient.getSiteScene} — the app's dashboard read. The
|
|
105
|
+
* battery detail lives under `solarbank_info.solarbank_list` (NOT a top-level list). Only the shape this
|
|
106
|
+
* SDK reads is typed; everything else (grid_info, home_load_power, function flags, …) is preserved by the
|
|
107
|
+
* index signature. This is a low-rate backstop, never the realtime telemetry source.
|
|
108
|
+
*/
|
|
109
|
+
export interface SolixSiteScene {
|
|
110
|
+
solarbank_info?: {
|
|
111
|
+
solarbank_list?: SolixSceneSolarbank[];
|
|
112
|
+
[k: string]: unknown;
|
|
113
|
+
};
|
|
114
|
+
[k: string]: unknown;
|
|
115
|
+
}
|