Expand description
A client library for the Octopus Energy API.
§Usage
To login and fetch account information:
use octopower::{authenticate, get_account};
let token = authenticate("email@address.example", "password").await?;
let account = get_account(&token, "A-1234ABCD").await?;
println!("Account information: {:?}", account);
Modules§
- results
- Types used for the results of API calls.
Structs§
- Auth
Token - A JWT token used for authenticated API requests.
Enums§
- ApiError
- An error communicating with the Octopus API.
- Grouping
- The level of aggregation with which to group electricity or gas consumption records.
- Meter
Type - The type of meter, either electricity or gas.
Functions§
- authenticate
- Authenticate to the Octopus API using the given email address and password, returning an authentication token which can be used for subsequent authenticated requests.
- get_
account - Fetch information about the given account from the Octopus REST API.
- get_
consumption - Fetch electricity or gas consumption records from the meter with the given
mpxn
(MPAN or MPRN) and serial.