GithubHelp home page GithubHelp logo

crzysdrs / solaredge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twistedfall/solaredge

0.0 2.0 0.0 54 KB

SolarEdge API client for Rust

License: GNU Affero General Public License v3.0

Rust 99.23% Shell 0.77%

solaredge's Introduction

solaredge

Documentation

See full documentation

Usage

Add this to your Cargo.toml:

[dependencies]
solaredge = "0.1.6"

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 interface. Check solaredge-reqwest for an implementation based on reqwest.

Sample usage with solaredge-reqwest:

use solaredge::{Client, SitesList, SortOrder, SiteStatus};
use solaredge_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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.