pub struct GenericDeviceHandler { /* private fields */ }Expand description
Handler for generic devices. It provides the functionality common to all Tapo devices.
If you’d like to propose support for a device that isn’t currently supported, please open an issue on GitHub to start the conversation.
Implementations§
Source§impl GenericDeviceHandler
impl GenericDeviceHandler
Sourcepub async fn refresh_session(&mut self) -> Result<&mut Self, Error>
pub async fn refresh_session(&mut self) -> Result<&mut Self, Error>
Refreshes the authentication session.
Sourcepub async fn get_device_info(&self) -> Result<DeviceInfoGenericResult, Error>
pub async fn get_device_info(&self) -> Result<DeviceInfoGenericResult, Error>
Returns device info as DeviceInfoGenericResult.
It is not guaranteed to contain all the properties returned from the Tapo API.
If the deserialization fails, or if a property that you care about it’s not present, try [GenericDeviceHandler::get_device_info_json].
Trait Implementations§
Source§impl Debug for GenericDeviceHandler
impl Debug for GenericDeviceHandler
Source§impl From<GenericDeviceHandler> for ColorLightHandler
impl From<GenericDeviceHandler> for ColorLightHandler
Source§fn from(value: GenericDeviceHandler) -> Self
fn from(value: GenericDeviceHandler) -> Self
Converts to this type from the input type.
Source§impl From<GenericDeviceHandler> for HubHandler
impl From<GenericDeviceHandler> for HubHandler
Source§fn from(value: GenericDeviceHandler) -> Self
fn from(value: GenericDeviceHandler) -> Self
Converts to this type from the input type.
Source§impl From<GenericDeviceHandler> for LightHandler
impl From<GenericDeviceHandler> for LightHandler
Source§fn from(value: GenericDeviceHandler) -> Self
fn from(value: GenericDeviceHandler) -> Self
Converts to this type from the input type.
Source§impl From<GenericDeviceHandler> for PlugEnergyMonitoringHandler
impl From<GenericDeviceHandler> for PlugEnergyMonitoringHandler
Source§fn from(value: GenericDeviceHandler) -> Self
fn from(value: GenericDeviceHandler) -> Self
Converts to this type from the input type.
Source§impl From<GenericDeviceHandler> for PlugHandler
impl From<GenericDeviceHandler> for PlugHandler
Source§fn from(value: GenericDeviceHandler) -> Self
fn from(value: GenericDeviceHandler) -> Self
Converts to this type from the input type.
Source§impl From<GenericDeviceHandler> for PowerStripEnergyMonitoringHandler
impl From<GenericDeviceHandler> for PowerStripEnergyMonitoringHandler
Source§fn from(value: GenericDeviceHandler) -> Self
fn from(value: GenericDeviceHandler) -> Self
Converts to this type from the input type.
Source§impl From<GenericDeviceHandler> for PowerStripHandler
impl From<GenericDeviceHandler> for PowerStripHandler
Source§fn from(value: GenericDeviceHandler) -> Self
fn from(value: GenericDeviceHandler) -> Self
Converts to this type from the input type.
Source§impl From<GenericDeviceHandler> for RgbLightStripHandler
impl From<GenericDeviceHandler> for RgbLightStripHandler
Source§fn from(value: GenericDeviceHandler) -> Self
fn from(value: GenericDeviceHandler) -> Self
Converts to this type from the input type.
Source§impl From<GenericDeviceHandler> for RgbicLightStripHandler
impl From<GenericDeviceHandler> for RgbicLightStripHandler
Source§fn from(value: GenericDeviceHandler) -> Self
fn from(value: GenericDeviceHandler) -> Self
Converts to this type from the input type.
Source§impl HandlerExt for GenericDeviceHandler
impl HandlerExt for GenericDeviceHandler
Source§fn get_client<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RwLockReadGuard<'_, dyn ApiClientExt>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_client<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RwLockReadGuard<'_, dyn ApiClientExt>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the client used by this handler.
Auto Trait Implementations§
impl Freeze for GenericDeviceHandler
impl !RefUnwindSafe for GenericDeviceHandler
impl Send for GenericDeviceHandler
impl Sync for GenericDeviceHandler
impl Unpin for GenericDeviceHandler
impl UnsafeUnpin for GenericDeviceHandler
impl !UnwindSafe for GenericDeviceHandler
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more