pub struct Gen1Device { /* private fields */ }Implementations§
Source§impl Gen1Device
impl Gen1Device
pub fn new(info: DeviceInfo, client: Client, password: Option<String>) -> Self
Sourcepub fn new_with_host(
info: DeviceInfo,
base_host: String,
client: Client,
password: Option<String>,
) -> Self
pub fn new_with_host( info: DeviceInfo, base_host: String, client: Client, password: Option<String>, ) -> Self
Build a Gen1Device addressed by an explicit host[:port] string
rather than info.ip, so a device that isn’t reachable on the
default port (or that must be reached by a test harness on an
ephemeral loopback port) can still be targeted.
pub fn info(&self) -> &DeviceInfo
pub async fn status(&self) -> Result<DeviceStatus>
pub async fn switch_status(&self, id: u8) -> Result<SwitchStatus>
pub async fn switch_set(&self, id: u8, on: bool) -> Result<SwitchResult>
pub async fn switch_toggle(&self, id: u8) -> Result<SwitchResult>
pub async fn power(&self, id: u8) -> Result<PowerReading>
pub async fn firmware_check(&self) -> Result<FirmwareInfo>
pub async fn config_get(&self) -> Result<Value>
pub async fn reboot(&self) -> Result<()>
pub async fn firmware_update(&self) -> Result<()>
pub async fn config_set(&self, key: &str, value: &str) -> Result<Value>
pub async fn schedule_list(&self) -> Result<Value>
pub async fn webhook_list(&self) -> Result<Value>
pub async fn config_restore(&self, config: &Value) -> Result<()>
pub async fn set_name(&self, name: &str) -> Result<()>
Auto Trait Implementations§
impl !RefUnwindSafe for Gen1Device
impl !UnwindSafe for Gen1Device
impl Freeze for Gen1Device
impl Send for Gen1Device
impl Sync for Gen1Device
impl Unpin for Gen1Device
impl UnsafeUnpin for Gen1Device
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