tesla-fleet-api
Version:
A library for the [Tesla Fleet API](https://developer.tesla.com/docs/fleet-api), and the third parties services [Teslemetry](https://teslemetry.com/docs/getting-started/api) and [Tessie](https://developer.tessie.com/docs/tesla-api-comparison), which provi
78 lines (77 loc) • 4.56 kB
TypeScript
import Energy from "./energy.js";
import { LiveStatusResponse } from "./types/live_status.js";
import { SiteInfoResponse } from "./types/site_info.js";
export default class EnergySpecific {
parent: Energy;
energy_site_id: number;
constructor(parent: Energy, energy_site_id: number);
/**
* Adjust the site's backup reserve.
* @param backup_reserve_percent The desired backup reserve percent.
* @returns
*/
backup(backup_reserve_percent: number): Promise<Record<string, any>>;
/**
* Returns the backup (off-grid) event history of the site in duration of seconds.
* @param kind The kind of history to be requested. 'backup', 'charge', 'energy' are all supported.
* @param start_date Start date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
* @param end_date End date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
* @param period Period of the window to retrieve backup events. This can be day, week, month, year, lifetime and should align with the window requested.
* @param time_zone Timezone of the requested window in IANA name format. i.e. 'America/Los_Angeles'
* @returns
*/
backup_history(kind: string, start_date: string, end_date: string, period: string, time_zone: string): Promise<Record<string, any>>;
/**
* Returns the charging history of a wall connector.
* @param kind The kind of history to be requested. 'backup', 'charge', 'energy' are all supported.
* @param start_date Start date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
* @param end_date End date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
* @param time_zone Timezone of the requested window in IANA name format. i.e. 'America/Los_Angeles'
* @returns
*/
charge_history(kind: string, start_date: string, end_date: string, time_zone: string): Promise<Record<string, any>>;
/**
* Returns the energy history of the site in duration of seconds.
* @param kind The kind of history to be requested. 'backup', 'charge', 'energy' are all supported.
* @param start_date Start date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
* @param end_date End date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
* @param period Period of the window to retrieve backup events. This can be day, week, month, year, lifetime and should align with the window requested.
* @param time_zone Timezone of the requested window in IANA name format. i.e. 'America/Los_Angeles'
* @returns
*/
energy_history(kind: string, start_date: string, end_date: string, period: string, time_zone: string): Promise<Record<string, any>>;
/**
* Allow/disallow charging from the grid and exporting energy to the grid.
* @param disallow_charge_from_grid_with_solar_installed The desired behavior towards importing from the grid. Charging from the grid is disabled when set to true and enabled when set to false.
* @param customer_preferred_export_rule The desired behavior for grid exporting. The available options are battery_ok, pv_only, and never.
* @returns
*/
grid_import_export(disallow_charge_from_grid_with_solar_installed?: boolean | null, customer_preferred_export_rule?: string | null): Promise<Record<string, any>>;
/**
* Returns the live status of the site.
* @returns
*/
live_status(): Promise<LiveStatusResponse>;
/**
* Adjust the site's off-grid vehicle charging backup reserve.
* @param off_grid_vehicle_charging_reserve_percent The desired off grid vehicle charging reserve percent.
* @returns
*/
off_grid_vehicle_charging_reserve(off_grid_vehicle_charging_reserve_percent: number): Promise<Record<string, any>>;
/**
* Set the site's mode.
* @param default_real_mode
* @returns
*/
operation(default_real_mode: string): Promise<Record<string, any>>;
/**
* Returns information about the site. Things like assets (has solar, etc), settings (backup reserve, etc), and features (storm_mode_capable, etc).
*/
site_info(): Promise<SiteInfoResponse>;
/**
* Update storm watch participation.
* @param enabled The storm mode participation value to set.
* @returns
*/
storm_mode(enabled: boolean): Promise<Record<string, any>>;
}