Skip to main content

new

Creates a new Growatt client with default configuration.
pub fn new() -> Self

Returns

Returns a new Growatt instance with:
  • Base URL set to https://server.growatt.com
  • HTTP client configured with cookie storage
  • Session duration of 30 minutes
  • No credentials (requires manual login)

Example

use growatt_api::Growatt;

let mut client = Growatt::new();

// Login with credentials
client.login("username", "password").await?;
The client automatically manages cookies and session state. You only need to call login() once.

default

Creates a new Growatt client using the Default trait implementation.
impl Default for Growatt {
    fn default() -> Self
}

Returns

Returns a new Growatt instance with the same configuration as new().

Example

use growatt_api::Growatt;

let mut client = Growatt::default();
This method is functionally identical to new() and is provided for convenience when using trait-based initialization patterns.

Build docs developers (and LLMs) love