Energy Storage
High-level API
Device name:
energy_storageProvided by any energy storage connected through a bus interface, such as a charger.
Methods
canExtractEnergy():booleanGets whether energy can be taken out of the storage.
- Returns whether the storage allows extracting energy.
canReceiveEnergy():booleanGets whether energy can be put into the storage.
- Returns whether the storage allows receiving energy.
getEnergyStored():numberGets how much energy is currently stored.
- Returns the stored amount of energy.
getMaxEnergyStored():numberGets how much energy can be stored at most.
- Returns the capacity of the storage.
Mid-level API
Device name:
ENERGYAmounts are four bytes, low byte first. Amounts past
0xFFFFFFFF read as 0xFFFFFFFF.Methods
1 getEnergyStoredGets how much energy is currently stored.
- Returns four bytes, the stored amount of energy.
2 getMaxEnergyStoredGets how much energy can be stored at most.
- Returns four bytes, the capacity of the storage.
3 canExtractEnergyGets whether energy can be taken out of the storage.
- Returns one byte,
1 if the storage allows extracting energy, 0 otherwise.4 canReceiveEnergyGets whether energy can be put into the storage.
- Returns one byte,
1 if the storage allows receiving energy, 0 otherwise.