14 releases

0.4.2 Sep 12, 2024
0.4.1 Mar 22, 2024
0.4.0 Nov 17, 2023
0.3.1 May 18, 2023
0.1.5 Aug 31, 2021

#96 in HTTP client

Download history 30/week @ 2024-07-25 8/week @ 2024-08-01 127/week @ 2024-09-12 11/week @ 2024-09-19 9/week @ 2024-09-26 6/week @ 2024-10-03

572 downloads per month
Used in solaredge-reqwest

LGPL-3.0

56KB
1.5K SLoC

solaredge

Documentation

See full documentation

Usage

Add this to your Cargo.toml:

[dependencies]
solaredge = "0.4.2"

Asynchronous SolarEdge API client for Rust

Work in progress, only basic API is implemented so far. See todo markers in client.rs for the specific missing functions.

Enables access the SolarEdge equipment API (solar panels, inverters, meters) with the nice typed Rust interface.

The library requires an HTTP client, but is client-agnostic. You can use any client that implements HttpClientAdapter trait. Check http-adapter-reqwest for an implementation based on reqwest.

Sample usage with http-adapter-reqwest:

use solaredge::{Client, SitesList, SortOrder, SiteStatus};
use http_adapter_reqwest::ReqwestAdapter;

async fn run() -> Result<(), Box<dyn std::error::Error>> {
   let client = Client::<ReqwestAdapter>::new("API_KEY");
   let version = client.version_current().await?;
   let mut p = SitesList::default();
   p.size = Some(32);
   p.sort_order = Some(SortOrder::Ascending);
   p.status = Some(&[SiteStatus::Active, SiteStatus::Pending]);
   let sites = client.sites_list(&p).await?;
   Ok(())
}

License: LGPL-3.0

Dependencies

~4–6MB
~100K SLoC