Skip to main content

ShineMonitorAPI

Struct ShineMonitorAPI 

Source
pub struct ShineMonitorAPI { /* private fields */ }

Implementations§

Source§

impl ShineMonitorAPI

Source

pub fn update_token(&self) -> Result<Value, ApiError>

Action updateToken — chapter 2. Vendor docs: https://api.shinemonitor.com/chapter2/updateToken.html

Source

pub fn query_account_info(&self) -> Result<Value, ApiError>

Action queryAccountInfo — chapter 2. Vendor docs: https://api.shinemonitor.com/chapter2/queryAccountInfo.html

Source

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

Source

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

Source

pub fn query_plant_info(&self, plantid: i64) -> Result<Value, ApiError>

Action queryPlantInfo — chapter 3. Vendor docs: https://api.shinemonitor.com/chapter3/queryPlantInfo.html

Source

pub fn query_plant_count(&self) -> Result<Value, ApiError>

Action queryPlantCount — chapter 3. Vendor docs: https://api.shinemonitor.com/chapter3/queryPlantCount.html

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn query_collector_info(&self, pn: &str) -> Result<Value, ApiError>

Action queryCollectorInfo — chapter 4. Vendor docs: https://api.shinemonitor.com/chapter4/queryCollectorInfo.html

Source

pub fn query_collector_status(&self, pn: &str) -> Result<Value, ApiError>

Action queryCollectorStatus — chapter 4. Vendor docs: https://api.shinemonitor.com/chapter4/queryCollectorStatus.html

Source

pub fn query_collector_devices(&self, pn: &str) -> Result<Value, ApiError>

Action queryCollectorDevices — chapter 4. Vendor docs: https://api.shinemonitor.com/chapter4/queryCollectorDevices.html

Source

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

Source

pub fn web_query_device_es(&self) -> Result<Value, ApiError>

Source

pub fn query_device_count(&self) -> Result<Value, ApiError>

Action queryDeviceCount — chapter 5. Vendor docs: https://api.shinemonitor.com/chapter5/queryDeviceCount.html

Source

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

Source

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

Source

pub fn query_sp_device_last_data( &self, pn: &str, devcode: i64, devaddr: i64, sn: &str, ) -> Result<Value, ApiError>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

pub fn query_camera_info(&self, cameraid: i64) -> Result<Value, ApiError>

Action queryCameraInfo — chapter 11. Vendor docs: https://api.shinemonitor.com/chapter11/queryCameraInfo.html

Source

pub fn upload_img(&self, fmt: &str) -> Result<Value, ApiError>

Action uploadImg — chapter 84. Vendor docs: https://api.shinemonitor.com/chapter84/uploadImg.html

Source§

impl ShineMonitorAPI

Source

pub fn new( serial_number: &str, wifi_pn: &str, dev_code: i32, dev_addr: i32, ) -> Self

Source

pub fn with_base_url(self, base_url: impl Into<String>) -> Self

Source

pub fn with_suffix_context(self, suffix: impl Into<String>) -> Self

Source

pub fn with_company_key(self, key: impl Into<String>) -> Self

Source

pub fn login(&mut self, username: &str, password: &str) -> Result<(), ApiError>

Source

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.

Source

pub fn get_daily_data(&self, day: NaiveDate) -> Result<Value, ApiError>

Source

pub fn get_last_data(&self) -> Result<ShineMonitorLastData, ApiError>

Trait Implementations§

Source§

impl Clone for ShineMonitorAPI

Source§

fn clone(&self) -> ShineMonitorAPI

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ShineMonitorAPI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more