@enyo-energy/energy-app-sdk 0.0.117 → 0.0.119
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/cjs/energy-app-permission.type.cjs +1 -0
- package/dist/cjs/energy-app-permission.type.d.cts +2 -1
- package/dist/cjs/energy-app.cjs +9 -0
- package/dist/cjs/energy-app.d.cts +8 -0
- package/dist/cjs/enyo-energy-app-sdk.d.cts +3 -0
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.d.cts +2 -0
- package/dist/cjs/packages/energy-app-mqtt.d.cts +21 -1
- package/dist/cjs/packages/energy-app-wifi.cjs +2 -0
- package/dist/cjs/packages/energy-app-wifi.d.cts +38 -0
- package/dist/cjs/types/enyo-charger-appliance.cjs +2 -0
- package/dist/cjs/types/enyo-charger-appliance.d.cts +3 -1
- package/dist/cjs/types/enyo-data-bus-value.cjs +2 -0
- package/dist/cjs/types/enyo-data-bus-value.d.cts +3 -1
- package/dist/cjs/types/enyo-mqtt.d.cts +28 -0
- package/dist/cjs/types/enyo-wifi.cjs +2 -0
- package/dist/cjs/types/enyo-wifi.d.cts +80 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/cjs/version.d.cts +1 -1
- package/dist/energy-app-permission.type.d.ts +2 -1
- package/dist/energy-app-permission.type.js +1 -0
- package/dist/energy-app.d.ts +8 -0
- package/dist/energy-app.js +9 -0
- package/dist/enyo-energy-app-sdk.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/packages/energy-app-mqtt.d.ts +21 -1
- package/dist/packages/energy-app-wifi.d.ts +38 -0
- package/dist/packages/energy-app-wifi.js +1 -0
- package/dist/types/enyo-charger-appliance.d.ts +3 -1
- package/dist/types/enyo-charger-appliance.js +2 -0
- package/dist/types/enyo-data-bus-value.d.ts +3 -1
- package/dist/types/enyo-data-bus-value.js +2 -0
- package/dist/types/enyo-mqtt.d.ts +28 -0
- package/dist/types/enyo-wifi.d.ts +80 -0
- package/dist/types/enyo-wifi.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -41,5 +41,6 @@ var EnergyAppPermissionTypeEnum;
|
|
|
41
41
|
EnergyAppPermissionTypeEnum["EebusControl"] = "EebusControl";
|
|
42
42
|
EnergyAppPermissionTypeEnum["Mqtt"] = "Mqtt";
|
|
43
43
|
EnergyAppPermissionTypeEnum["Bluetooth"] = "Bluetooth";
|
|
44
|
+
EnergyAppPermissionTypeEnum["Wifi"] = "Wifi";
|
|
44
45
|
EnergyAppPermissionTypeEnum["ChildProcess"] = "ChildProcess";
|
|
45
46
|
})(EnergyAppPermissionTypeEnum || (exports.EnergyAppPermissionTypeEnum = EnergyAppPermissionTypeEnum = {}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type EnergyAppPermissionType = 'RestrictedInternetAccess' | 'NetworkDeviceDiscovery' | 'NetworkDeviceSearch' | 'NetworkDeviceAccess' | 'Modbus' | 'Storage' | 'Appliance' | 'AllAppliances' | 'SendDataBusValues' | 'SubscribeDataBus' | 'SendDataBusCommands' | 'OcppServer' | 'ChargingCard' | 'Vehicle' | 'Charge' | 'SecretManager' | 'LocationZipCode' | 'LocationCoordinates' | 'Timeseries' | 'EnergyManagerInfo' | 'ElectricityTariff' | 'WeatherForecastRegister' | 'WeatherForecastUse' | 'PvForecastRegister' | 'PvForecastUse' | 'PvSystemRegister' | 'PvSystemUse' | 'InverterControlCommands' | 'BatteryControlCommands' | 'ChargerControlCommands' | 'ModbusRtu' | 'EnergyPrices' | 'EnergyManager' | 'EebusDeviceManagement' | 'EebusDataAccess' | 'EebusControl' | 'Mqtt' | 'Bluetooth' | 'ChildProcess';
|
|
1
|
+
export type EnergyAppPermissionType = 'RestrictedInternetAccess' | 'NetworkDeviceDiscovery' | 'NetworkDeviceSearch' | 'NetworkDeviceAccess' | 'Modbus' | 'Storage' | 'Appliance' | 'AllAppliances' | 'SendDataBusValues' | 'SubscribeDataBus' | 'SendDataBusCommands' | 'OcppServer' | 'ChargingCard' | 'Vehicle' | 'Charge' | 'SecretManager' | 'LocationZipCode' | 'LocationCoordinates' | 'Timeseries' | 'EnergyManagerInfo' | 'ElectricityTariff' | 'WeatherForecastRegister' | 'WeatherForecastUse' | 'PvForecastRegister' | 'PvForecastUse' | 'PvSystemRegister' | 'PvSystemUse' | 'InverterControlCommands' | 'BatteryControlCommands' | 'ChargerControlCommands' | 'ModbusRtu' | 'EnergyPrices' | 'EnergyManager' | 'EebusDeviceManagement' | 'EebusDataAccess' | 'EebusControl' | 'Mqtt' | 'Bluetooth' | 'Wifi' | 'ChildProcess';
|
|
2
2
|
export declare enum EnergyAppPermissionTypeEnum {
|
|
3
3
|
RestrictedInternetAccess = "RestrictedInternetAccess",
|
|
4
4
|
NetworkDeviceDiscovery = "NetworkDeviceDiscovery",
|
|
@@ -38,5 +38,6 @@ export declare enum EnergyAppPermissionTypeEnum {
|
|
|
38
38
|
EebusControl = "EebusControl",
|
|
39
39
|
Mqtt = "Mqtt",
|
|
40
40
|
Bluetooth = "Bluetooth",
|
|
41
|
+
Wifi = "Wifi",
|
|
41
42
|
ChildProcess = "ChildProcess"
|
|
42
43
|
}
|
package/dist/cjs/energy-app.cjs
CHANGED
|
@@ -237,6 +237,15 @@ class EnergyApp {
|
|
|
237
237
|
useLearningPhase() {
|
|
238
238
|
return this.energyAppSdk.useLearningPhase();
|
|
239
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* Gets the WiFi API for scanning and listing known WiFi networks (SSIDs).
|
|
242
|
+
* Provides methods to discover saved/known SSIDs that are currently
|
|
243
|
+
* in range of the device's WiFi adapter.
|
|
244
|
+
* @returns The WiFi API instance
|
|
245
|
+
*/
|
|
246
|
+
useWifi() {
|
|
247
|
+
return this.energyAppSdk.useWifi();
|
|
248
|
+
}
|
|
240
249
|
/**
|
|
241
250
|
* Gets the current SDK version.
|
|
242
251
|
* @returns The semantic version string of the SDK
|
|
@@ -30,6 +30,7 @@ import { EnergyAppMqtt } from "./packages/energy-app-mqtt.cjs";
|
|
|
30
30
|
import { EnergyAppBluetooth } from "./packages/energy-app-bluetooth.cjs";
|
|
31
31
|
import { EnergyAppDiagnostics } from "./packages/energy-app-diagnostics.cjs";
|
|
32
32
|
import { EnergyAppLearningPhase } from "./packages/energy-app-learning-phase.cjs";
|
|
33
|
+
import { EnergyAppWifi } from "./packages/energy-app-wifi.cjs";
|
|
33
34
|
/**
|
|
34
35
|
* Concrete implementation of {@link EnyoEnergyAppSdk} that delegates every call
|
|
35
36
|
* to the runtime-provided `energyAppSdkInstance` global.
|
|
@@ -176,6 +177,13 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
|
176
177
|
* @returns The Learning Phase API instance
|
|
177
178
|
*/
|
|
178
179
|
useLearningPhase(): EnergyAppLearningPhase;
|
|
180
|
+
/**
|
|
181
|
+
* Gets the WiFi API for scanning and listing known WiFi networks (SSIDs).
|
|
182
|
+
* Provides methods to discover saved/known SSIDs that are currently
|
|
183
|
+
* in range of the device's WiFi adapter.
|
|
184
|
+
* @returns The WiFi API instance
|
|
185
|
+
*/
|
|
186
|
+
useWifi(): EnergyAppWifi;
|
|
179
187
|
/**
|
|
180
188
|
* Gets the current SDK version.
|
|
181
189
|
* @returns The semantic version string of the SDK
|
|
@@ -29,6 +29,7 @@ import { EnergyAppMqtt } from "./packages/energy-app-mqtt.cjs";
|
|
|
29
29
|
import { EnergyAppBluetooth } from "./packages/energy-app-bluetooth.cjs";
|
|
30
30
|
import { EnergyAppDiagnostics } from "./packages/energy-app-diagnostics.cjs";
|
|
31
31
|
import { EnergyAppLearningPhase } from "./packages/energy-app-learning-phase.cjs";
|
|
32
|
+
import { EnergyAppWifi } from "./packages/energy-app-wifi.cjs";
|
|
32
33
|
export declare enum EnergyAppStateEnum {
|
|
33
34
|
Launching = "launching",
|
|
34
35
|
Running = "running",
|
|
@@ -115,4 +116,6 @@ export interface EnyoEnergyAppSdk {
|
|
|
115
116
|
useDiagnostics: () => EnergyAppDiagnostics;
|
|
116
117
|
/** Get the Learning Phase API for registering and tracking learning phases */
|
|
117
118
|
useLearningPhase: () => EnergyAppLearningPhase;
|
|
119
|
+
/** Get the WiFi API for scanning and listing known SSIDs */
|
|
120
|
+
useWifi: () => EnergyAppWifi;
|
|
118
121
|
}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -57,6 +57,8 @@ __exportStar(require("./types/enyo-diagnostics.cjs"), exports);
|
|
|
57
57
|
__exportStar(require("./packages/energy-app-diagnostics.cjs"), exports);
|
|
58
58
|
__exportStar(require("./types/enyo-learning-phase.cjs"), exports);
|
|
59
59
|
__exportStar(require("./packages/energy-app-learning-phase.cjs"), exports);
|
|
60
|
+
__exportStar(require("./types/enyo-wifi.cjs"), exports);
|
|
61
|
+
__exportStar(require("./packages/energy-app-wifi.cjs"), exports);
|
|
60
62
|
__exportStar(require("./types/enyo-air-conditioning-appliance.cjs"), exports);
|
|
61
63
|
__exportStar(require("./types/enyo-onboarding.cjs"), exports);
|
|
62
64
|
__exportStar(require("./packages/energy-app-onboarding.cjs"), exports);
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -41,6 +41,8 @@ export * from './types/enyo-diagnostics.cjs';
|
|
|
41
41
|
export * from './packages/energy-app-diagnostics.cjs';
|
|
42
42
|
export * from './types/enyo-learning-phase.cjs';
|
|
43
43
|
export * from './packages/energy-app-learning-phase.cjs';
|
|
44
|
+
export * from './types/enyo-wifi.cjs';
|
|
45
|
+
export * from './packages/energy-app-wifi.cjs';
|
|
44
46
|
export * from './types/enyo-air-conditioning-appliance.cjs';
|
|
45
47
|
export * from './types/enyo-onboarding.cjs';
|
|
46
48
|
export * from './packages/energy-app-onboarding.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MqttConnectOptions, MqttExternalConnectOptions, MqttConnectionStatus, MqttSubscribeOptions, MqttPublishOptions, MqttMessage } from "../types/enyo-mqtt.cjs";
|
|
1
|
+
import { MqttConnectOptions, MqttExternalConnectOptions, MqttConnectionStatus, MqttSubscribeOptions, MqttPublishOptions, MqttMessage, EnyoMqttAvailableConnectionDetails } from "../types/enyo-mqtt.cjs";
|
|
2
2
|
/**
|
|
3
3
|
* Interface for MQTT communication in enyo packages.
|
|
4
4
|
* Provides MQTT client functionality with support for both the SDK-provided
|
|
@@ -59,6 +59,26 @@ export interface EnergyAppMqtt {
|
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
61
|
connect: (options: MqttExternalConnectOptions) => Promise<EnergyAppMqttClient>;
|
|
62
|
+
/**
|
|
63
|
+
* Get connection details for MQTT brokers exposed to the energy app.
|
|
64
|
+
* Currently returns details for the SDK-provided local MQTT broker so callers
|
|
65
|
+
* can connect with their own MQTT client implementation when {@link connectInternal}
|
|
66
|
+
* is not suitable (e.g. bridging to another runtime, configuring a third-party
|
|
67
|
+
* library, or providing the broker address to an external process).
|
|
68
|
+
*
|
|
69
|
+
* Mirrors the OCPP `getAvailableConnectionDetails` API.
|
|
70
|
+
*
|
|
71
|
+
* @returns A map of available broker connection details, keyed by scope (e.g. `local`).
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const details = await mqtt.getAvailableConnectionDetails();
|
|
76
|
+
* if (details.local) {
|
|
77
|
+
* console.log(`Local broker available at ${details.local.url}`);
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
getAvailableConnectionDetails: () => Promise<EnyoMqttAvailableConnectionDetails>;
|
|
62
82
|
}
|
|
63
83
|
/**
|
|
64
84
|
* Represents an active MQTT client connection.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EnergyAppWifiSsid } from "../types/enyo-wifi.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* WiFi API for enyo packages.
|
|
4
|
+
*
|
|
5
|
+
* Provides discovery of WiFi networks (SSIDs) currently visible to the
|
|
6
|
+
* device's WiFi adapter. All operations require the package to declare the
|
|
7
|
+
* `Wifi` permission.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const wifi = energyApp.useWifi();
|
|
12
|
+
*
|
|
13
|
+
* // Discover all known SSIDs that are currently in range
|
|
14
|
+
* const knownNetworks = await wifi.getKnownSsids();
|
|
15
|
+
* for (const network of knownNetworks) {
|
|
16
|
+
* console.log(`${network.ssid} @ ${network.rssi} dBm`);
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export interface EnergyAppWifi {
|
|
21
|
+
/**
|
|
22
|
+
* Run a WiFi scan and return all known SSIDs that were discovered.
|
|
23
|
+
*
|
|
24
|
+
* "Known" means the network is currently saved on the device — i.e. the
|
|
25
|
+
* device has previously joined it and credentials are stored. Networks
|
|
26
|
+
* that are visible but not saved are not returned by this method.
|
|
27
|
+
*
|
|
28
|
+
* The scan is synchronous from the caller's perspective: the returned
|
|
29
|
+
* promise resolves once the underlying WiFi stack has finished its
|
|
30
|
+
* discovery sweep. Each call performs a fresh scan; results are not
|
|
31
|
+
* cached between calls.
|
|
32
|
+
*
|
|
33
|
+
* @returns Promise resolving with the list of known SSIDs that were
|
|
34
|
+
* discovered during the scan. The list is empty when no known
|
|
35
|
+
* networks are currently in range.
|
|
36
|
+
*/
|
|
37
|
+
getKnownSsids(): Promise<EnergyAppWifiSsid[]>;
|
|
38
|
+
}
|
|
@@ -45,4 +45,6 @@ var EnyoChargerApplianceAvailableFeaturesEnum;
|
|
|
45
45
|
EnyoChargerApplianceAvailableFeaturesEnum["RebootCharger"] = "RebootCharger";
|
|
46
46
|
/** If the charger supports requesting log file uploads */
|
|
47
47
|
EnyoChargerApplianceAvailableFeaturesEnum["RequestLogFiles"] = "RequestLogFiles";
|
|
48
|
+
/** If the Charger supprots a pv surplus mode */
|
|
49
|
+
EnyoChargerApplianceAvailableFeaturesEnum["PvSurplusMode"] = "PvSurplusMode";
|
|
48
50
|
})(EnyoChargerApplianceAvailableFeaturesEnum || (exports.EnyoChargerApplianceAvailableFeaturesEnum = EnyoChargerApplianceAvailableFeaturesEnum = {}));
|
|
@@ -58,7 +58,9 @@ export declare enum EnyoChargerApplianceAvailableFeaturesEnum {
|
|
|
58
58
|
/** If the charger supports being rebooted */
|
|
59
59
|
RebootCharger = "RebootCharger",
|
|
60
60
|
/** If the charger supports requesting log file uploads */
|
|
61
|
-
RequestLogFiles = "RequestLogFiles"
|
|
61
|
+
RequestLogFiles = "RequestLogFiles",
|
|
62
|
+
/** If the Charger supprots a pv surplus mode */
|
|
63
|
+
PvSurplusMode = "PvSurplusMode"
|
|
62
64
|
}
|
|
63
65
|
export interface EnyoChargerApplianceMetadata {
|
|
64
66
|
availableFeatures: EnyoChargerApplianceAvailableFeaturesEnum[];
|
|
@@ -106,6 +106,8 @@ var EnyoChargeModeEnum;
|
|
|
106
106
|
EnyoChargeModeEnum["CostOptimized"] = "cost-optimized";
|
|
107
107
|
/** Optimize charging schedule for a maximum price limit, for example 7 ct grid or pv production */
|
|
108
108
|
EnyoChargeModeEnum["PriceLimit"] = "price-limit";
|
|
109
|
+
/** Charge only from PV surplus, using excess solar production that would otherwise be fed into the grid */
|
|
110
|
+
EnyoChargeModeEnum["PvSurplus"] = "pv-surplus";
|
|
109
111
|
})(EnyoChargeModeEnum || (exports.EnyoChargeModeEnum = EnyoChargeModeEnum = {}));
|
|
110
112
|
var EnyoDataBusMessageEnum;
|
|
111
113
|
(function (EnyoDataBusMessageEnum) {
|
|
@@ -122,7 +122,9 @@ export declare enum EnyoChargeModeEnum {
|
|
|
122
122
|
/** Optimize charging schedule for lowest cost */
|
|
123
123
|
CostOptimized = "cost-optimized",
|
|
124
124
|
/** Optimize charging schedule for a maximum price limit, for example 7 ct grid or pv production */
|
|
125
|
-
PriceLimit = "price-limit"
|
|
125
|
+
PriceLimit = "price-limit",
|
|
126
|
+
/** Charge only from PV surplus, using excess solar production that would otherwise be fed into the grid */
|
|
127
|
+
PvSurplus = "pv-surplus"
|
|
126
128
|
}
|
|
127
129
|
export interface EnyoAggregatedStateApplianceValues {
|
|
128
130
|
gridPowerW?: number;
|
|
@@ -84,6 +84,34 @@ export interface MqttPublishOptions {
|
|
|
84
84
|
/** Whether the broker should retain this message as the last known value for the topic (default: false) */
|
|
85
85
|
retain?: boolean;
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Connection details for an MQTT broker exposed to the energy app.
|
|
89
|
+
* Returned by {@link EnergyAppMqtt.getAvailableConnectionDetails} so callers can
|
|
90
|
+
* connect to the broker using their own MQTT client implementation if needed.
|
|
91
|
+
*/
|
|
92
|
+
export interface EnyoMqttAvailableConnectionDetail {
|
|
93
|
+
/** Fully qualified broker URL including protocol and port (e.g. "mqtt://127.0.0.1:1883" or "mqtts://broker.local:8883") */
|
|
94
|
+
url: string;
|
|
95
|
+
/** Broker hostname or IP address (e.g. "127.0.0.1") */
|
|
96
|
+
host: string;
|
|
97
|
+
/** Broker TCP port (e.g. 1883 for plain, 8883 for TLS) */
|
|
98
|
+
port: number;
|
|
99
|
+
/** Whether the broker requires a TLS/SSL connection */
|
|
100
|
+
secure: boolean;
|
|
101
|
+
/** Username for broker authentication, if required */
|
|
102
|
+
username?: string;
|
|
103
|
+
/** Password for broker authentication, if required */
|
|
104
|
+
password?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Map of available MQTT broker connection details by scope.
|
|
108
|
+
* Mirrors the structure of OCPP available connection details so callers can
|
|
109
|
+
* uniformly discover broker endpoints exposed by the runtime.
|
|
110
|
+
*/
|
|
111
|
+
export interface EnyoMqttAvailableConnectionDetails {
|
|
112
|
+
/** Connection details for the SDK-provided local MQTT broker, when available */
|
|
113
|
+
local?: EnyoMqttAvailableConnectionDetail;
|
|
114
|
+
}
|
|
87
115
|
/**
|
|
88
116
|
* Represents an incoming MQTT message received on a subscribed topic.
|
|
89
117
|
*/
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Closed set of error codes raised by the WiFi API.
|
|
3
|
+
*
|
|
4
|
+
* - `permission_denied`: package is missing the `Wifi` permission.
|
|
5
|
+
* - `adapter_unavailable`: no WiFi adapter is present or the radio is disabled.
|
|
6
|
+
* - `scan_in_progress`: a concurrent scan request was rejected.
|
|
7
|
+
* - `scan_failed`: the underlying WiFi stack reported a failure during scanning.
|
|
8
|
+
* - `timeout`: the scan exceeded its allotted time.
|
|
9
|
+
*/
|
|
10
|
+
export type EnergyAppWifiErrorCode = 'permission_denied' | 'adapter_unavailable' | 'scan_in_progress' | 'scan_failed' | 'timeout';
|
|
11
|
+
/**
|
|
12
|
+
* Error subtype thrown by the WiFi API.
|
|
13
|
+
* Always carries a structured {@link EnergyAppWifiErrorCode}; callers
|
|
14
|
+
* should branch on `code` rather than parsing the human-readable message.
|
|
15
|
+
*/
|
|
16
|
+
export interface EnergyAppWifiError extends Error {
|
|
17
|
+
/** Machine-readable error code. */
|
|
18
|
+
readonly code: EnergyAppWifiErrorCode;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Security mode advertised by a discovered WiFi network.
|
|
22
|
+
*
|
|
23
|
+
* - `open`: no encryption; the network is unprotected.
|
|
24
|
+
* - `wep`: deprecated WEP encryption.
|
|
25
|
+
* - `wpa`: WPA-Personal (TKIP/AES).
|
|
26
|
+
* - `wpa2`: WPA2-Personal.
|
|
27
|
+
* - `wpa3`: WPA3-Personal.
|
|
28
|
+
* - `wpa2_enterprise`: WPA2-Enterprise (802.1X).
|
|
29
|
+
* - `wpa3_enterprise`: WPA3-Enterprise (802.1X).
|
|
30
|
+
* - `unknown`: the security mode could not be determined from the beacon.
|
|
31
|
+
*/
|
|
32
|
+
export type EnergyAppWifiSecurity = 'open' | 'wep' | 'wpa' | 'wpa2' | 'wpa3' | 'wpa2_enterprise' | 'wpa3_enterprise' | 'unknown';
|
|
33
|
+
/**
|
|
34
|
+
* A WiFi network (SSID) discovered during a scan.
|
|
35
|
+
*
|
|
36
|
+
* The shape mirrors what is available in the WiFi beacon/probe response;
|
|
37
|
+
* values that are not present are omitted rather than zeroed.
|
|
38
|
+
*/
|
|
39
|
+
export interface EnergyAppWifiSsid {
|
|
40
|
+
/**
|
|
41
|
+
* The network name (SSID) as broadcast by the access point.
|
|
42
|
+
* Empty string for hidden networks that do not broadcast their SSID.
|
|
43
|
+
*/
|
|
44
|
+
ssid: string;
|
|
45
|
+
/**
|
|
46
|
+
* BSSID of the access point in uppercase, colon-separated form
|
|
47
|
+
* (e.g. "AA:BB:CC:DD:EE:FF"). When multiple APs broadcast the same SSID
|
|
48
|
+
* (roaming), the strongest one is reported.
|
|
49
|
+
*/
|
|
50
|
+
bssid?: string;
|
|
51
|
+
/** Last received signal strength indicator in dBm. */
|
|
52
|
+
rssi?: number;
|
|
53
|
+
/** Operating channel number on which the network was observed. */
|
|
54
|
+
channel?: number;
|
|
55
|
+
/** Operating frequency in MHz on which the network was observed. */
|
|
56
|
+
frequencyMhz?: number;
|
|
57
|
+
/** Security mode advertised by the access point. */
|
|
58
|
+
security?: EnergyAppWifiSecurity;
|
|
59
|
+
/**
|
|
60
|
+
* `true` when the network is currently saved/known on the device, meaning
|
|
61
|
+
* credentials are stored and the device can auto-connect.
|
|
62
|
+
*/
|
|
63
|
+
known?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Options controlling a single WiFi discovery run.
|
|
67
|
+
*/
|
|
68
|
+
export interface EnergyAppWifiScanOptions {
|
|
69
|
+
/**
|
|
70
|
+
* Wall-clock duration of the scan in milliseconds. Defaults to 5000;
|
|
71
|
+
* the host caps this value at 30000 to protect the WiFi adapter.
|
|
72
|
+
*/
|
|
73
|
+
durationMs?: number;
|
|
74
|
+
/**
|
|
75
|
+
* When `true`, restrict the result to networks that are currently saved
|
|
76
|
+
* on the device (i.e. SSIDs the device has previously joined).
|
|
77
|
+
* Defaults to `false`.
|
|
78
|
+
*/
|
|
79
|
+
onlyKnown?: boolean;
|
|
80
|
+
}
|
package/dist/cjs/version.cjs
CHANGED
|
@@ -9,7 +9,7 @@ exports.getSdkVersion = getSdkVersion;
|
|
|
9
9
|
/**
|
|
10
10
|
* Current version of the enyo Energy App SDK.
|
|
11
11
|
*/
|
|
12
|
-
exports.SDK_VERSION = '0.0.
|
|
12
|
+
exports.SDK_VERSION = '0.0.119';
|
|
13
13
|
/**
|
|
14
14
|
* Gets the current SDK version.
|
|
15
15
|
* @returns The semantic version string of the SDK
|
package/dist/cjs/version.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type EnergyAppPermissionType = 'RestrictedInternetAccess' | 'NetworkDeviceDiscovery' | 'NetworkDeviceSearch' | 'NetworkDeviceAccess' | 'Modbus' | 'Storage' | 'Appliance' | 'AllAppliances' | 'SendDataBusValues' | 'SubscribeDataBus' | 'SendDataBusCommands' | 'OcppServer' | 'ChargingCard' | 'Vehicle' | 'Charge' | 'SecretManager' | 'LocationZipCode' | 'LocationCoordinates' | 'Timeseries' | 'EnergyManagerInfo' | 'ElectricityTariff' | 'WeatherForecastRegister' | 'WeatherForecastUse' | 'PvForecastRegister' | 'PvForecastUse' | 'PvSystemRegister' | 'PvSystemUse' | 'InverterControlCommands' | 'BatteryControlCommands' | 'ChargerControlCommands' | 'ModbusRtu' | 'EnergyPrices' | 'EnergyManager' | 'EebusDeviceManagement' | 'EebusDataAccess' | 'EebusControl' | 'Mqtt' | 'Bluetooth' | 'ChildProcess';
|
|
1
|
+
export type EnergyAppPermissionType = 'RestrictedInternetAccess' | 'NetworkDeviceDiscovery' | 'NetworkDeviceSearch' | 'NetworkDeviceAccess' | 'Modbus' | 'Storage' | 'Appliance' | 'AllAppliances' | 'SendDataBusValues' | 'SubscribeDataBus' | 'SendDataBusCommands' | 'OcppServer' | 'ChargingCard' | 'Vehicle' | 'Charge' | 'SecretManager' | 'LocationZipCode' | 'LocationCoordinates' | 'Timeseries' | 'EnergyManagerInfo' | 'ElectricityTariff' | 'WeatherForecastRegister' | 'WeatherForecastUse' | 'PvForecastRegister' | 'PvForecastUse' | 'PvSystemRegister' | 'PvSystemUse' | 'InverterControlCommands' | 'BatteryControlCommands' | 'ChargerControlCommands' | 'ModbusRtu' | 'EnergyPrices' | 'EnergyManager' | 'EebusDeviceManagement' | 'EebusDataAccess' | 'EebusControl' | 'Mqtt' | 'Bluetooth' | 'Wifi' | 'ChildProcess';
|
|
2
2
|
export declare enum EnergyAppPermissionTypeEnum {
|
|
3
3
|
RestrictedInternetAccess = "RestrictedInternetAccess",
|
|
4
4
|
NetworkDeviceDiscovery = "NetworkDeviceDiscovery",
|
|
@@ -38,5 +38,6 @@ export declare enum EnergyAppPermissionTypeEnum {
|
|
|
38
38
|
EebusControl = "EebusControl",
|
|
39
39
|
Mqtt = "Mqtt",
|
|
40
40
|
Bluetooth = "Bluetooth",
|
|
41
|
+
Wifi = "Wifi",
|
|
41
42
|
ChildProcess = "ChildProcess"
|
|
42
43
|
}
|
|
@@ -38,5 +38,6 @@ export var EnergyAppPermissionTypeEnum;
|
|
|
38
38
|
EnergyAppPermissionTypeEnum["EebusControl"] = "EebusControl";
|
|
39
39
|
EnergyAppPermissionTypeEnum["Mqtt"] = "Mqtt";
|
|
40
40
|
EnergyAppPermissionTypeEnum["Bluetooth"] = "Bluetooth";
|
|
41
|
+
EnergyAppPermissionTypeEnum["Wifi"] = "Wifi";
|
|
41
42
|
EnergyAppPermissionTypeEnum["ChildProcess"] = "ChildProcess";
|
|
42
43
|
})(EnergyAppPermissionTypeEnum || (EnergyAppPermissionTypeEnum = {}));
|
package/dist/energy-app.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ import { EnergyAppMqtt } from "./packages/energy-app-mqtt.js";
|
|
|
30
30
|
import { EnergyAppBluetooth } from "./packages/energy-app-bluetooth.js";
|
|
31
31
|
import { EnergyAppDiagnostics } from "./packages/energy-app-diagnostics.js";
|
|
32
32
|
import { EnergyAppLearningPhase } from "./packages/energy-app-learning-phase.js";
|
|
33
|
+
import { EnergyAppWifi } from "./packages/energy-app-wifi.js";
|
|
33
34
|
/**
|
|
34
35
|
* Concrete implementation of {@link EnyoEnergyAppSdk} that delegates every call
|
|
35
36
|
* to the runtime-provided `energyAppSdkInstance` global.
|
|
@@ -176,6 +177,13 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
|
176
177
|
* @returns The Learning Phase API instance
|
|
177
178
|
*/
|
|
178
179
|
useLearningPhase(): EnergyAppLearningPhase;
|
|
180
|
+
/**
|
|
181
|
+
* Gets the WiFi API for scanning and listing known WiFi networks (SSIDs).
|
|
182
|
+
* Provides methods to discover saved/known SSIDs that are currently
|
|
183
|
+
* in range of the device's WiFi adapter.
|
|
184
|
+
* @returns The WiFi API instance
|
|
185
|
+
*/
|
|
186
|
+
useWifi(): EnergyAppWifi;
|
|
179
187
|
/**
|
|
180
188
|
* Gets the current SDK version.
|
|
181
189
|
* @returns The semantic version string of the SDK
|
package/dist/energy-app.js
CHANGED
|
@@ -234,6 +234,15 @@ export class EnergyApp {
|
|
|
234
234
|
useLearningPhase() {
|
|
235
235
|
return this.energyAppSdk.useLearningPhase();
|
|
236
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* Gets the WiFi API for scanning and listing known WiFi networks (SSIDs).
|
|
239
|
+
* Provides methods to discover saved/known SSIDs that are currently
|
|
240
|
+
* in range of the device's WiFi adapter.
|
|
241
|
+
* @returns The WiFi API instance
|
|
242
|
+
*/
|
|
243
|
+
useWifi() {
|
|
244
|
+
return this.energyAppSdk.useWifi();
|
|
245
|
+
}
|
|
237
246
|
/**
|
|
238
247
|
* Gets the current SDK version.
|
|
239
248
|
* @returns The semantic version string of the SDK
|
|
@@ -29,6 +29,7 @@ import { EnergyAppMqtt } from "./packages/energy-app-mqtt.js";
|
|
|
29
29
|
import { EnergyAppBluetooth } from "./packages/energy-app-bluetooth.js";
|
|
30
30
|
import { EnergyAppDiagnostics } from "./packages/energy-app-diagnostics.js";
|
|
31
31
|
import { EnergyAppLearningPhase } from "./packages/energy-app-learning-phase.js";
|
|
32
|
+
import { EnergyAppWifi } from "./packages/energy-app-wifi.js";
|
|
32
33
|
export declare enum EnergyAppStateEnum {
|
|
33
34
|
Launching = "launching",
|
|
34
35
|
Running = "running",
|
|
@@ -115,4 +116,6 @@ export interface EnyoEnergyAppSdk {
|
|
|
115
116
|
useDiagnostics: () => EnergyAppDiagnostics;
|
|
116
117
|
/** Get the Learning Phase API for registering and tracking learning phases */
|
|
117
118
|
useLearningPhase: () => EnergyAppLearningPhase;
|
|
119
|
+
/** Get the WiFi API for scanning and listing known SSIDs */
|
|
120
|
+
useWifi: () => EnergyAppWifi;
|
|
118
121
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ export * from './types/enyo-diagnostics.js';
|
|
|
41
41
|
export * from './packages/energy-app-diagnostics.js';
|
|
42
42
|
export * from './types/enyo-learning-phase.js';
|
|
43
43
|
export * from './packages/energy-app-learning-phase.js';
|
|
44
|
+
export * from './types/enyo-wifi.js';
|
|
45
|
+
export * from './packages/energy-app-wifi.js';
|
|
44
46
|
export * from './types/enyo-air-conditioning-appliance.js';
|
|
45
47
|
export * from './types/enyo-onboarding.js';
|
|
46
48
|
export * from './packages/energy-app-onboarding.js';
|
package/dist/index.js
CHANGED
|
@@ -41,6 +41,8 @@ export * from './types/enyo-diagnostics.js';
|
|
|
41
41
|
export * from './packages/energy-app-diagnostics.js';
|
|
42
42
|
export * from './types/enyo-learning-phase.js';
|
|
43
43
|
export * from './packages/energy-app-learning-phase.js';
|
|
44
|
+
export * from './types/enyo-wifi.js';
|
|
45
|
+
export * from './packages/energy-app-wifi.js';
|
|
44
46
|
export * from './types/enyo-air-conditioning-appliance.js';
|
|
45
47
|
export * from './types/enyo-onboarding.js';
|
|
46
48
|
export * from './packages/energy-app-onboarding.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MqttConnectOptions, MqttExternalConnectOptions, MqttConnectionStatus, MqttSubscribeOptions, MqttPublishOptions, MqttMessage } from "../types/enyo-mqtt.js";
|
|
1
|
+
import { MqttConnectOptions, MqttExternalConnectOptions, MqttConnectionStatus, MqttSubscribeOptions, MqttPublishOptions, MqttMessage, EnyoMqttAvailableConnectionDetails } from "../types/enyo-mqtt.js";
|
|
2
2
|
/**
|
|
3
3
|
* Interface for MQTT communication in enyo packages.
|
|
4
4
|
* Provides MQTT client functionality with support for both the SDK-provided
|
|
@@ -59,6 +59,26 @@ export interface EnergyAppMqtt {
|
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
61
|
connect: (options: MqttExternalConnectOptions) => Promise<EnergyAppMqttClient>;
|
|
62
|
+
/**
|
|
63
|
+
* Get connection details for MQTT brokers exposed to the energy app.
|
|
64
|
+
* Currently returns details for the SDK-provided local MQTT broker so callers
|
|
65
|
+
* can connect with their own MQTT client implementation when {@link connectInternal}
|
|
66
|
+
* is not suitable (e.g. bridging to another runtime, configuring a third-party
|
|
67
|
+
* library, or providing the broker address to an external process).
|
|
68
|
+
*
|
|
69
|
+
* Mirrors the OCPP `getAvailableConnectionDetails` API.
|
|
70
|
+
*
|
|
71
|
+
* @returns A map of available broker connection details, keyed by scope (e.g. `local`).
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const details = await mqtt.getAvailableConnectionDetails();
|
|
76
|
+
* if (details.local) {
|
|
77
|
+
* console.log(`Local broker available at ${details.local.url}`);
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
getAvailableConnectionDetails: () => Promise<EnyoMqttAvailableConnectionDetails>;
|
|
62
82
|
}
|
|
63
83
|
/**
|
|
64
84
|
* Represents an active MQTT client connection.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EnergyAppWifiSsid } from "../types/enyo-wifi.js";
|
|
2
|
+
/**
|
|
3
|
+
* WiFi API for enyo packages.
|
|
4
|
+
*
|
|
5
|
+
* Provides discovery of WiFi networks (SSIDs) currently visible to the
|
|
6
|
+
* device's WiFi adapter. All operations require the package to declare the
|
|
7
|
+
* `Wifi` permission.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const wifi = energyApp.useWifi();
|
|
12
|
+
*
|
|
13
|
+
* // Discover all known SSIDs that are currently in range
|
|
14
|
+
* const knownNetworks = await wifi.getKnownSsids();
|
|
15
|
+
* for (const network of knownNetworks) {
|
|
16
|
+
* console.log(`${network.ssid} @ ${network.rssi} dBm`);
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export interface EnergyAppWifi {
|
|
21
|
+
/**
|
|
22
|
+
* Run a WiFi scan and return all known SSIDs that were discovered.
|
|
23
|
+
*
|
|
24
|
+
* "Known" means the network is currently saved on the device — i.e. the
|
|
25
|
+
* device has previously joined it and credentials are stored. Networks
|
|
26
|
+
* that are visible but not saved are not returned by this method.
|
|
27
|
+
*
|
|
28
|
+
* The scan is synchronous from the caller's perspective: the returned
|
|
29
|
+
* promise resolves once the underlying WiFi stack has finished its
|
|
30
|
+
* discovery sweep. Each call performs a fresh scan; results are not
|
|
31
|
+
* cached between calls.
|
|
32
|
+
*
|
|
33
|
+
* @returns Promise resolving with the list of known SSIDs that were
|
|
34
|
+
* discovered during the scan. The list is empty when no known
|
|
35
|
+
* networks are currently in range.
|
|
36
|
+
*/
|
|
37
|
+
getKnownSsids(): Promise<EnergyAppWifiSsid[]>;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -58,7 +58,9 @@ export declare enum EnyoChargerApplianceAvailableFeaturesEnum {
|
|
|
58
58
|
/** If the charger supports being rebooted */
|
|
59
59
|
RebootCharger = "RebootCharger",
|
|
60
60
|
/** If the charger supports requesting log file uploads */
|
|
61
|
-
RequestLogFiles = "RequestLogFiles"
|
|
61
|
+
RequestLogFiles = "RequestLogFiles",
|
|
62
|
+
/** If the Charger supprots a pv surplus mode */
|
|
63
|
+
PvSurplusMode = "PvSurplusMode"
|
|
62
64
|
}
|
|
63
65
|
export interface EnyoChargerApplianceMetadata {
|
|
64
66
|
availableFeatures: EnyoChargerApplianceAvailableFeaturesEnum[];
|
|
@@ -42,4 +42,6 @@ export var EnyoChargerApplianceAvailableFeaturesEnum;
|
|
|
42
42
|
EnyoChargerApplianceAvailableFeaturesEnum["RebootCharger"] = "RebootCharger";
|
|
43
43
|
/** If the charger supports requesting log file uploads */
|
|
44
44
|
EnyoChargerApplianceAvailableFeaturesEnum["RequestLogFiles"] = "RequestLogFiles";
|
|
45
|
+
/** If the Charger supprots a pv surplus mode */
|
|
46
|
+
EnyoChargerApplianceAvailableFeaturesEnum["PvSurplusMode"] = "PvSurplusMode";
|
|
45
47
|
})(EnyoChargerApplianceAvailableFeaturesEnum || (EnyoChargerApplianceAvailableFeaturesEnum = {}));
|
|
@@ -122,7 +122,9 @@ export declare enum EnyoChargeModeEnum {
|
|
|
122
122
|
/** Optimize charging schedule for lowest cost */
|
|
123
123
|
CostOptimized = "cost-optimized",
|
|
124
124
|
/** Optimize charging schedule for a maximum price limit, for example 7 ct grid or pv production */
|
|
125
|
-
PriceLimit = "price-limit"
|
|
125
|
+
PriceLimit = "price-limit",
|
|
126
|
+
/** Charge only from PV surplus, using excess solar production that would otherwise be fed into the grid */
|
|
127
|
+
PvSurplus = "pv-surplus"
|
|
126
128
|
}
|
|
127
129
|
export interface EnyoAggregatedStateApplianceValues {
|
|
128
130
|
gridPowerW?: number;
|
|
@@ -103,6 +103,8 @@ export var EnyoChargeModeEnum;
|
|
|
103
103
|
EnyoChargeModeEnum["CostOptimized"] = "cost-optimized";
|
|
104
104
|
/** Optimize charging schedule for a maximum price limit, for example 7 ct grid or pv production */
|
|
105
105
|
EnyoChargeModeEnum["PriceLimit"] = "price-limit";
|
|
106
|
+
/** Charge only from PV surplus, using excess solar production that would otherwise be fed into the grid */
|
|
107
|
+
EnyoChargeModeEnum["PvSurplus"] = "pv-surplus";
|
|
106
108
|
})(EnyoChargeModeEnum || (EnyoChargeModeEnum = {}));
|
|
107
109
|
export var EnyoDataBusMessageEnum;
|
|
108
110
|
(function (EnyoDataBusMessageEnum) {
|
|
@@ -84,6 +84,34 @@ export interface MqttPublishOptions {
|
|
|
84
84
|
/** Whether the broker should retain this message as the last known value for the topic (default: false) */
|
|
85
85
|
retain?: boolean;
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Connection details for an MQTT broker exposed to the energy app.
|
|
89
|
+
* Returned by {@link EnergyAppMqtt.getAvailableConnectionDetails} so callers can
|
|
90
|
+
* connect to the broker using their own MQTT client implementation if needed.
|
|
91
|
+
*/
|
|
92
|
+
export interface EnyoMqttAvailableConnectionDetail {
|
|
93
|
+
/** Fully qualified broker URL including protocol and port (e.g. "mqtt://127.0.0.1:1883" or "mqtts://broker.local:8883") */
|
|
94
|
+
url: string;
|
|
95
|
+
/** Broker hostname or IP address (e.g. "127.0.0.1") */
|
|
96
|
+
host: string;
|
|
97
|
+
/** Broker TCP port (e.g. 1883 for plain, 8883 for TLS) */
|
|
98
|
+
port: number;
|
|
99
|
+
/** Whether the broker requires a TLS/SSL connection */
|
|
100
|
+
secure: boolean;
|
|
101
|
+
/** Username for broker authentication, if required */
|
|
102
|
+
username?: string;
|
|
103
|
+
/** Password for broker authentication, if required */
|
|
104
|
+
password?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Map of available MQTT broker connection details by scope.
|
|
108
|
+
* Mirrors the structure of OCPP available connection details so callers can
|
|
109
|
+
* uniformly discover broker endpoints exposed by the runtime.
|
|
110
|
+
*/
|
|
111
|
+
export interface EnyoMqttAvailableConnectionDetails {
|
|
112
|
+
/** Connection details for the SDK-provided local MQTT broker, when available */
|
|
113
|
+
local?: EnyoMqttAvailableConnectionDetail;
|
|
114
|
+
}
|
|
87
115
|
/**
|
|
88
116
|
* Represents an incoming MQTT message received on a subscribed topic.
|
|
89
117
|
*/
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Closed set of error codes raised by the WiFi API.
|
|
3
|
+
*
|
|
4
|
+
* - `permission_denied`: package is missing the `Wifi` permission.
|
|
5
|
+
* - `adapter_unavailable`: no WiFi adapter is present or the radio is disabled.
|
|
6
|
+
* - `scan_in_progress`: a concurrent scan request was rejected.
|
|
7
|
+
* - `scan_failed`: the underlying WiFi stack reported a failure during scanning.
|
|
8
|
+
* - `timeout`: the scan exceeded its allotted time.
|
|
9
|
+
*/
|
|
10
|
+
export type EnergyAppWifiErrorCode = 'permission_denied' | 'adapter_unavailable' | 'scan_in_progress' | 'scan_failed' | 'timeout';
|
|
11
|
+
/**
|
|
12
|
+
* Error subtype thrown by the WiFi API.
|
|
13
|
+
* Always carries a structured {@link EnergyAppWifiErrorCode}; callers
|
|
14
|
+
* should branch on `code` rather than parsing the human-readable message.
|
|
15
|
+
*/
|
|
16
|
+
export interface EnergyAppWifiError extends Error {
|
|
17
|
+
/** Machine-readable error code. */
|
|
18
|
+
readonly code: EnergyAppWifiErrorCode;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Security mode advertised by a discovered WiFi network.
|
|
22
|
+
*
|
|
23
|
+
* - `open`: no encryption; the network is unprotected.
|
|
24
|
+
* - `wep`: deprecated WEP encryption.
|
|
25
|
+
* - `wpa`: WPA-Personal (TKIP/AES).
|
|
26
|
+
* - `wpa2`: WPA2-Personal.
|
|
27
|
+
* - `wpa3`: WPA3-Personal.
|
|
28
|
+
* - `wpa2_enterprise`: WPA2-Enterprise (802.1X).
|
|
29
|
+
* - `wpa3_enterprise`: WPA3-Enterprise (802.1X).
|
|
30
|
+
* - `unknown`: the security mode could not be determined from the beacon.
|
|
31
|
+
*/
|
|
32
|
+
export type EnergyAppWifiSecurity = 'open' | 'wep' | 'wpa' | 'wpa2' | 'wpa3' | 'wpa2_enterprise' | 'wpa3_enterprise' | 'unknown';
|
|
33
|
+
/**
|
|
34
|
+
* A WiFi network (SSID) discovered during a scan.
|
|
35
|
+
*
|
|
36
|
+
* The shape mirrors what is available in the WiFi beacon/probe response;
|
|
37
|
+
* values that are not present are omitted rather than zeroed.
|
|
38
|
+
*/
|
|
39
|
+
export interface EnergyAppWifiSsid {
|
|
40
|
+
/**
|
|
41
|
+
* The network name (SSID) as broadcast by the access point.
|
|
42
|
+
* Empty string for hidden networks that do not broadcast their SSID.
|
|
43
|
+
*/
|
|
44
|
+
ssid: string;
|
|
45
|
+
/**
|
|
46
|
+
* BSSID of the access point in uppercase, colon-separated form
|
|
47
|
+
* (e.g. "AA:BB:CC:DD:EE:FF"). When multiple APs broadcast the same SSID
|
|
48
|
+
* (roaming), the strongest one is reported.
|
|
49
|
+
*/
|
|
50
|
+
bssid?: string;
|
|
51
|
+
/** Last received signal strength indicator in dBm. */
|
|
52
|
+
rssi?: number;
|
|
53
|
+
/** Operating channel number on which the network was observed. */
|
|
54
|
+
channel?: number;
|
|
55
|
+
/** Operating frequency in MHz on which the network was observed. */
|
|
56
|
+
frequencyMhz?: number;
|
|
57
|
+
/** Security mode advertised by the access point. */
|
|
58
|
+
security?: EnergyAppWifiSecurity;
|
|
59
|
+
/**
|
|
60
|
+
* `true` when the network is currently saved/known on the device, meaning
|
|
61
|
+
* credentials are stored and the device can auto-connect.
|
|
62
|
+
*/
|
|
63
|
+
known?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Options controlling a single WiFi discovery run.
|
|
67
|
+
*/
|
|
68
|
+
export interface EnergyAppWifiScanOptions {
|
|
69
|
+
/**
|
|
70
|
+
* Wall-clock duration of the scan in milliseconds. Defaults to 5000;
|
|
71
|
+
* the host caps this value at 30000 to protect the WiFi adapter.
|
|
72
|
+
*/
|
|
73
|
+
durationMs?: number;
|
|
74
|
+
/**
|
|
75
|
+
* When `true`, restrict the result to networks that are currently saved
|
|
76
|
+
* on the device (i.e. SSIDs the device has previously joined).
|
|
77
|
+
* Defaults to `false`.
|
|
78
|
+
*/
|
|
79
|
+
onlyKnown?: boolean;
|
|
80
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED