pub enum DeviceType {
GenericDevice,
Light,
ColorLight,
RgbLightStrip,
RgbicLightStrip,
Plug,
PlugEnergyMonitoring,
PowerStrip,
PowerStripEnergyMonitoring,
Hub,
}Expand description
Categorizes a Tapo device by its capabilities.
This enum maps model strings (e.g. “L530”, “P110”) to a high-level device category, centralizing the model-string-to-category logic in one place.
Variants§
GenericDevice
A generic/unknown Tapo device.
Light
Tapo L510, L520, L610 — dimmable lights.
ColorLight
Tapo L530, L535, L630 — color lights.
RgbLightStrip
Tapo L900 — RGB light strip.
RgbicLightStrip
Tapo L920, L930 — RGBIC light strip.
Plug
Tapo P100, P105 — smart plugs.
PlugEnergyMonitoring
Tapo P110, P110M, P115 — smart plugs with energy monitoring.
PowerStrip
Tapo P300, P306 — power strips.
PowerStripEnergyMonitoring
Tapo P304M, P316M — power strips with energy monitoring.
Hub
Tapo H100 — smart hub.
Implementations§
Source§impl DeviceType
impl DeviceType
Sourcepub fn from_model(model: &str) -> Self
pub fn from_model(model: &str) -> Self
Determines the device type from a model string.
Unknown models return DeviceType::GenericDevice.
Trait Implementations§
Source§impl Clone for DeviceType
impl Clone for DeviceType
Source§fn clone(&self) -> DeviceType
fn clone(&self) -> DeviceType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DeviceType
impl Debug for DeviceType
Source§impl<'de> Deserialize<'de> for DeviceType
impl<'de> Deserialize<'de> for DeviceType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DeviceType
impl Display for DeviceType
Source§impl Hash for DeviceType
impl Hash for DeviceType
Source§impl PartialEq for DeviceType
impl PartialEq for DeviceType
Source§impl Serialize for DeviceType
impl Serialize for DeviceType
impl Copy for DeviceType
impl Eq for DeviceType
impl StructuralPartialEq for DeviceType
Auto Trait Implementations§
impl Freeze for DeviceType
impl RefUnwindSafe for DeviceType
impl Send for DeviceType
impl Sync for DeviceType
impl Unpin for DeviceType
impl UnsafeUnpin for DeviceType
impl UnwindSafe for DeviceType
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.