Constructor
new Beeclear(optionsopt)
Example
// create a Beeclear session, login to device, fetch meter readings
const BeeClear = require('beeclear');
const bc = new BeeClear();
async function getMeterReadings() {
try {
await bc.login();
const powerInfo = await bc.getMeterReadings();
console.log(powerInfo);
} catch (error) {
console.log(error);
}
}
getMeterReadings();
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
sessionOptions |
<optional> |
configurable session options |
Methods
(async) discover() → {Promise.<address>}
Discover a Beeclear device in your local network
Returns:
The local IP address.
- Type
- Promise.<address>
(async) getDeviceInfo() → {Promise.<deviceInfo>}
Get the device information and settings.
Returns:
- Type
- Promise.<deviceInfo>
(async) getFirmwareList() → {Promise.<FWList>}
Get the online list of firmware verions.
Returns:
- Type
- Promise.<FWList>
(async) getMeterReadings(shortopt) → {Promise.<meterReadingsFull>|Promise.<meterReadingsShort>}
Get the power and gas meter readings.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
short |
boolean |
<optional> |
false
|
full or short meter readings |
Returns:
-
- Type
- Promise.<meterReadingsFull>
-
- Type
- Promise.<meterReadingsShort>
(async) getNetwork() → {Promise.<networkInfo>}
Get the network info.
Returns:
- Type
- Promise.<networkInfo>
(async) getStatus() → {Promise.<status>}
Get the P1 and SD card status.
Returns:
- Type
- Promise.<status>
(async) login(optionsopt) → {Promise.<loggedIn>}
Login to Beeclear. Passing options will override any existing session settings.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
sessionOptions |
<optional> |
configurable session options |
Returns:
The loggedIn state.
- Type
- Promise.<loggedIn>
(async) logout() → {Promise.<loggedOut>}
End session.
Returns:
- Type
- Promise.<loggedOut>
(async) reboot() → {Promise.<rebooting>}
Reboot device.
Returns:
- Type
- Promise.<rebooting>