pub struct SwitchBot { /* private fields */ }
Expand description
SwitchBot client.
Implementations§
Source§impl SwitchBot
impl SwitchBot
Sourcepub async fn get_climate(&self, dev: &Device) -> Result<Option<ClimateStatus>>
pub async fn get_climate(&self, dev: &Device) -> Result<Option<ClimateStatus>>
Get climate status.
Source§impl SwitchBot
impl SwitchBot
Sourcepub async fn get_devices(&self) -> Result<Vec<Device>>
pub async fn get_devices(&self) -> Result<Vec<Device>>
Get all devices.
Sourcepub async fn get_status(&self, dev: &Device) -> Result<DevStatus>
pub async fn get_status(&self, dev: &Device) -> Result<DevStatus>
Get device status.
Source§impl SwitchBot
impl SwitchBot
Sourcepub async fn get_hub2_status(&self, id: &str) -> Result<Hub2Status>
pub async fn get_hub2_status(&self, id: &str) -> Result<Hub2Status>
Get Hub 2 status.
Source§impl SwitchBot
impl SwitchBot
Sourcepub async fn get_io_thermo_hygrometer_status(
&self,
id: &str,
) -> Result<IOThermoHygrometerStatus>
pub async fn get_io_thermo_hygrometer_status( &self, id: &str, ) -> Result<IOThermoHygrometerStatus>
Get indoor/outdoor thermo-hygrometer status.
Source§impl SwitchBot
impl SwitchBot
Sourcepub fn new_from_env() -> Result<Self>
pub fn new_from_env() -> Result<Self>
Create a new SwitchBot client from environment variables.
Sourcepub fn new_from_token(token: &str) -> Result<Self>
pub fn new_from_token(token: &str) -> Result<Self>
Create a new SwitchBot client using the given token.
Sourcepub async fn get<T: for<'de> Deserialize<'de>>(&self, path: &str) -> Result<T>
pub async fn get<T: for<'de> Deserialize<'de>>(&self, path: &str) -> Result<T>
Issue HTTP GET request and parse response.
Auto Trait Implementations§
impl Freeze for SwitchBot
impl !RefUnwindSafe for SwitchBot
impl Send for SwitchBot
impl Sync for SwitchBot
impl Unpin for SwitchBot
impl !UnwindSafe for SwitchBot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more