The options for the RestClient.
Readonly
certificationThe URL for the certification endpoint. It is used for signing and acquiring certification for IoT devices. The URL is constructed by appending the '/iot-open/sign/certification' path to the restApiHost.
Readonly
deviceThe URL for fetching the list of devices.
Readonly
deviceThe URL for querying device quota information.
Represents a utility class that is used to handle requests.
Represents the host URL of the REST API. Use https://api-e.ecoflow.com for european accounts or https://api-a.ecoflow.com in the US.
Readonly
setSets the command URL for the REST API host and device quota.
Retrieves a device class instance.
Requests all device properties.
Device serial number
Retrieves a list of device class instances. To narrow down a device-type you may use the instanceOf operator.
const devices = await restClient.getDevices();
for (const device of devices) {
if (device instanceof SmartPlug) {
await device.switchOn();
}
}
A promise that resolves to an array of devices.
Receive a list of all devices connected to the account.
A promise that resolves to the device list response.
Requests credentials required to establish an MQTT connection.
An object containing the MQTT credentials. - certificateAccount: The certificate account. - certificatePassword: The certificate password. - url: The MQTT broker URL. - protocol: The MQTT protocol (e.g., MQTT or MQTT over WebSocket). - port: The MQTT broker port.
Returns an array of all serial numbers bound to the connected account.
An array of serial numbers.
Update device settings. Depending on the device type different settings can be updated.
Represents a RestClient object.
Param: opts
The options for the RestClient.