pub struct ShineMonitorAPI { /* private fields */ }Implementations§
Source§impl ShineMonitorAPI
impl ShineMonitorAPI
Sourcepub fn update_token(&self) -> Result<Value, ApiError>
pub fn update_token(&self) -> Result<Value, ApiError>
Action updateToken — chapter 2.
Vendor docs: https://api.shinemonitor.com/chapter2/updateToken.html
Sourcepub fn query_account_info(&self) -> Result<Value, ApiError>
pub fn query_account_info(&self) -> Result<Value, ApiError>
Action queryAccountInfo — chapter 2.
Vendor docs: https://api.shinemonitor.com/chapter2/queryAccountInfo.html
Sourcepub fn update_password(
&self,
old_pwd: &str,
new_pwd: &str,
) -> Result<Value, ApiError>
pub fn update_password( &self, old_pwd: &str, new_pwd: &str, ) -> Result<Value, ApiError>
Action updatePassword — chapter 2.
Vendor docs: https://api.shinemonitor.com/chapter2/updatePassword.html
Sourcepub fn query_plants(
&self,
status: Option<i64>,
order_by: Option<&str>,
plant_name: Option<&str>,
page: Option<i64>,
pagesize: Option<i64>,
) -> Result<Value, ApiError>
pub fn query_plants( &self, status: Option<i64>, order_by: Option<&str>, plant_name: Option<&str>, page: Option<i64>, pagesize: Option<i64>, ) -> Result<Value, ApiError>
Action queryPlants — chapter 3.
Vendor docs: https://api.shinemonitor.com/chapter3/queryPlants.html
Sourcepub fn query_plant_info(&self, plantid: i64) -> Result<Value, ApiError>
pub fn query_plant_info(&self, plantid: i64) -> Result<Value, ApiError>
Action queryPlantInfo — chapter 3.
Vendor docs: https://api.shinemonitor.com/chapter3/queryPlantInfo.html
Sourcepub fn query_plant_count(&self) -> Result<Value, ApiError>
pub fn query_plant_count(&self) -> Result<Value, ApiError>
Action queryPlantCount — chapter 3.
Vendor docs: https://api.shinemonitor.com/chapter3/queryPlantCount.html
Sourcepub fn query_plant_energy_day(
&self,
plantid: i64,
date: &str,
) -> Result<Value, ApiError>
pub fn query_plant_energy_day( &self, plantid: i64, date: &str, ) -> Result<Value, ApiError>
Action queryPlantEnergyDay — chapter 3.
Vendor docs: https://api.shinemonitor.com/chapter3/queryPlantEnergyDay.html
Sourcepub fn query_plant_energy_month(
&self,
plantid: i64,
date: &str,
) -> Result<Value, ApiError>
pub fn query_plant_energy_month( &self, plantid: i64, date: &str, ) -> Result<Value, ApiError>
Action queryPlantEnergyMonth — chapter 3.
Vendor docs: https://api.shinemonitor.com/chapter3/queryPlantEnergyMonth.html
Sourcepub fn query_plant_energy_year(
&self,
plantid: i64,
date: &str,
) -> Result<Value, ApiError>
pub fn query_plant_energy_year( &self, plantid: i64, date: &str, ) -> Result<Value, ApiError>
Action queryPlantEnergyYear — chapter 3.
Vendor docs: https://api.shinemonitor.com/chapter3/queryPlantEnergyYear.html
Sourcepub fn query_plant_energy_total(&self, plantid: i64) -> Result<Value, ApiError>
pub fn query_plant_energy_total(&self, plantid: i64) -> Result<Value, ApiError>
Action queryPlantEnergyTotal — chapter 3.
Vendor docs: https://api.shinemonitor.com/chapter3/queryPlantEnergyTotal.html
Sourcepub fn query_plant_active_ouput_power_current(
&self,
plantid: i64,
) -> Result<Value, ApiError>
pub fn query_plant_active_ouput_power_current( &self, plantid: i64, ) -> Result<Value, ApiError>
Action queryPlantActiveOuputPowerCurrent — chapter 3.
Vendor docs: https://api.shinemonitor.com/chapter3/queryPlantActiveOuputPowerCurrent.html
Sourcepub fn query_collectors(
&self,
page: Option<i64>,
pagesize: Option<i64>,
) -> Result<Value, ApiError>
pub fn query_collectors( &self, page: Option<i64>, pagesize: Option<i64>, ) -> Result<Value, ApiError>
Action queryCollectors — chapter 4.
Vendor docs: https://api.shinemonitor.com/chapter4/queryCollectors.html
Sourcepub fn query_collector_info(&self, pn: &str) -> Result<Value, ApiError>
pub fn query_collector_info(&self, pn: &str) -> Result<Value, ApiError>
Action queryCollectorInfo — chapter 4.
Vendor docs: https://api.shinemonitor.com/chapter4/queryCollectorInfo.html
Sourcepub fn query_collector_status(&self, pn: &str) -> Result<Value, ApiError>
pub fn query_collector_status(&self, pn: &str) -> Result<Value, ApiError>
Action queryCollectorStatus — chapter 4.
Vendor docs: https://api.shinemonitor.com/chapter4/queryCollectorStatus.html
Sourcepub fn query_collector_devices(&self, pn: &str) -> Result<Value, ApiError>
pub fn query_collector_devices(&self, pn: &str) -> Result<Value, ApiError>
Action queryCollectorDevices — chapter 4.
Vendor docs: https://api.shinemonitor.com/chapter4/queryCollectorDevices.html
Sourcepub fn query_devices(
&self,
page: Option<i64>,
pagesize: Option<i64>,
) -> Result<Value, ApiError>
pub fn query_devices( &self, page: Option<i64>, pagesize: Option<i64>, ) -> Result<Value, ApiError>
Action queryDevices — chapter 5.
Vendor docs: https://api.shinemonitor.com/chapter5/queryDevices.html
pub fn web_query_device_es(&self) -> Result<Value, ApiError>
Sourcepub fn query_device_count(&self) -> Result<Value, ApiError>
pub fn query_device_count(&self) -> Result<Value, ApiError>
Action queryDeviceCount — chapter 5.
Vendor docs: https://api.shinemonitor.com/chapter5/queryDeviceCount.html
Sourcepub fn query_device_info(
&self,
pn: &str,
devcode: i64,
devaddr: i64,
sn: &str,
) -> Result<Value, ApiError>
pub fn query_device_info( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, ) -> Result<Value, ApiError>
Action queryDeviceInfo — chapter 5.
Vendor docs: https://api.shinemonitor.com/chapter5/queryDeviceInfo.html
Sourcepub fn query_device_last_data(
&self,
pn: &str,
devcode: i64,
devaddr: i64,
sn: &str,
) -> Result<Value, ApiError>
pub fn query_device_last_data( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, ) -> Result<Value, ApiError>
Action queryDeviceLastData — chapter 5.
Vendor docs: https://api.shinemonitor.com/chapter5/queryDeviceLastData.html
pub fn query_sp_device_last_data( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, ) -> Result<Value, ApiError>
Sourcepub fn query_device_data_one_day(
&self,
pn: &str,
devcode: i64,
devaddr: i64,
sn: &str,
date: &str,
) -> Result<Value, ApiError>
pub fn query_device_data_one_day( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, date: &str, ) -> Result<Value, ApiError>
Action queryDeviceDataOneDay — chapter 5.
Vendor docs: https://api.shinemonitor.com/chapter5/queryDeviceDataOneDay.html
Sourcepub fn query_device_status(
&self,
pn: &str,
devcode: i64,
devaddr: i64,
sn: &str,
) -> Result<Value, ApiError>
pub fn query_device_status( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, ) -> Result<Value, ApiError>
Action queryDeviceStatus — chapter 5.
Vendor docs: https://api.shinemonitor.com/chapter5/queryDeviceStatus.html
Sourcepub fn query_device_warning(
&self,
pn: &str,
devcode: i64,
devaddr: i64,
sn: &str,
) -> Result<Value, ApiError>
pub fn query_device_warning( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, ) -> Result<Value, ApiError>
Action queryDeviceWarning — chapter 5.
Vendor docs: https://api.shinemonitor.com/chapter5/queryDeviceWarning.html
Sourcepub fn query_device_ctrl_field(
&self,
pn: &str,
devcode: i64,
devaddr: i64,
sn: &str,
) -> Result<Value, ApiError>
pub fn query_device_ctrl_field( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, ) -> Result<Value, ApiError>
Action queryDeviceCtrlField — chapter 5.
Vendor docs: https://api.shinemonitor.com/chapter5/queryDeviceCtrlField.html
Sourcepub fn query_device_ctrl_value(
&self,
pn: &str,
devcode: i64,
devaddr: i64,
sn: &str,
id: &str,
) -> Result<Value, ApiError>
pub fn query_device_ctrl_value( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, id: &str, ) -> Result<Value, ApiError>
Action queryDeviceCtrlValue — chapter 5.
Vendor docs: https://api.shinemonitor.com/chapter5/queryDeviceCtrlValue.html
Sourcepub fn ctrl_device(
&self,
pn: &str,
devcode: i64,
devaddr: i64,
sn: &str,
id: &str,
val: &str,
) -> Result<Value, ApiError>
pub fn ctrl_device( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, id: &str, val: &str, ) -> Result<Value, ApiError>
Action ctrlDevice — chapter 5.
Vendor docs: https://api.shinemonitor.com/chapter5/ctrlDevice.html
Sourcepub fn query_device_energy_day(
&self,
pn: &str,
devcode: i64,
devaddr: i64,
sn: &str,
date: &str,
) -> Result<Value, ApiError>
pub fn query_device_energy_day( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, date: &str, ) -> Result<Value, ApiError>
Action queryDeviceEnergyDay — chapter 6.
Vendor docs: https://api.shinemonitor.com/chapter6/queryDeviceEnergyDay.html
Sourcepub fn query_device_energy_month(
&self,
pn: &str,
devcode: i64,
devaddr: i64,
sn: &str,
date: &str,
) -> Result<Value, ApiError>
pub fn query_device_energy_month( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, date: &str, ) -> Result<Value, ApiError>
Action queryDeviceEnergyMonth — chapter 6.
Vendor docs: https://api.shinemonitor.com/chapter6/queryDeviceEnergyMonth.html
Sourcepub fn query_device_energy_year(
&self,
pn: &str,
devcode: i64,
devaddr: i64,
sn: &str,
date: &str,
) -> Result<Value, ApiError>
pub fn query_device_energy_year( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, date: &str, ) -> Result<Value, ApiError>
Action queryDeviceEnergyYear — chapter 6.
Vendor docs: https://api.shinemonitor.com/chapter6/queryDeviceEnergyYear.html
Sourcepub fn query_device_energy_total(
&self,
pn: &str,
devcode: i64,
devaddr: i64,
sn: &str,
) -> Result<Value, ApiError>
pub fn query_device_energy_total( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, ) -> Result<Value, ApiError>
Action queryDeviceEnergyTotal — chapter 6.
Vendor docs: https://api.shinemonitor.com/chapter6/queryDeviceEnergyTotal.html
Sourcepub fn query_device_active_ouput_power_current(
&self,
pn: &str,
devcode: i64,
devaddr: i64,
sn: &str,
) -> Result<Value, ApiError>
pub fn query_device_active_ouput_power_current( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, ) -> Result<Value, ApiError>
Action queryDeviceActiveOuputPowerCurrent — chapter 6.
Vendor docs: https://api.shinemonitor.com/chapter6/queryDeviceActiveOuputPowerCurrent.html
Source§impl ShineMonitorAPI
impl ShineMonitorAPI
pub fn new( serial_number: &str, wifi_pn: &str, dev_code: i32, dev_addr: i32, ) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_suffix_context(self, suffix: impl Into<String>) -> Self
pub fn with_company_key(self, key: impl Into<String>) -> Self
pub fn login(&mut self, username: &str, password: &str) -> Result<(), ApiError>
Sourcepub fn _request_with(&self, action: &str, extra: &str) -> ShineMonitorAPIResult
pub fn _request_with(&self, action: &str, extra: &str) -> ShineMonitorAPIResult
Sign and dispatch a request whose base_action was assembled by the
caller. The generated action methods in actions.rs use this so they
don’t have to drag the legacy device-params into every call.
pub fn get_daily_data(&self, day: NaiveDate) -> Result<Value, ApiError>
pub fn get_last_data(&self) -> Result<ShineMonitorLastData, ApiError>
Trait Implementations§
Source§impl Clone for ShineMonitorAPI
impl Clone for ShineMonitorAPI
Source§fn clone(&self) -> ShineMonitorAPI
fn clone(&self) -> ShineMonitorAPI
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more