Skip to main content

DiscoveryResult

Enum DiscoveryResult 

Source
pub enum DiscoveryResult {
    GenericDevice {
        device_info: Box<DeviceInfoGenericResult>,
        handler: GenericDeviceHandler,
    },
    Light {
        device_info: Box<DeviceInfoLightResult>,
        handler: LightHandler,
    },
    ColorLight {
        device_info: Box<DeviceInfoColorLightResult>,
        handler: ColorLightHandler,
    },
    RgbLightStrip {
        device_info: Box<DeviceInfoRgbLightStripResult>,
        handler: RgbLightStripHandler,
    },
    RgbicLightStrip {
        device_info: Box<DeviceInfoRgbicLightStripResult>,
        handler: RgbicLightStripHandler,
    },
    Plug {
        device_info: Box<DeviceInfoPlugResult>,
        handler: PlugHandler,
    },
    PlugEnergyMonitoring {
        device_info: Box<DeviceInfoPlugEnergyMonitoringResult>,
        handler: PlugEnergyMonitoringHandler,
    },
    PowerStrip {
        device_info: Box<DeviceInfoPowerStripResult>,
        handler: PowerStripHandler,
    },
    PowerStripEnergyMonitoring {
        device_info: Box<DeviceInfoPowerStripResult>,
        handler: PowerStripEnergyMonitoringHandler,
    },
    Hub {
        device_info: Box<DeviceInfoHubResult>,
        handler: HubHandler,
    },
}
Expand description

Result of the device discovery process.

Variants§

§

GenericDevice

A Generic Tapo device.

If you believe this device is already supported, or would like to explore adding support for a currently unsupported model, please open an issue on GitHub to start the discussion.

Fields

§device_info: Box<DeviceInfoGenericResult>

Device info of a Generic Tapo device.

If you believe this device is already supported, or would like to explore adding support for a currently unsupported model, please open an issue on GitHub to start the discussion.

§handler: GenericDeviceHandler

Handler for generic devices. It provides the functionality common to all Tapo devices.

If you believe this device is already supported, or would like to explore adding support for a currently unsupported model, please open an issue on GitHub to start the discussion.

§

Light

Tapo L510, L520 and L610 devices.

Fields

§device_info: Box<DeviceInfoLightResult>

Device info of Tapo L510, L520 and L610.

§handler: LightHandler

Handler for the L510, L520 and L610 devices.

§

ColorLight

Tapo L530, L535 and L630 devices.

Fields

§device_info: Box<DeviceInfoColorLightResult>

Device info of Tapo L530, L535 and L630.

§handler: ColorLightHandler

Handler for the L530, L535 and L630 devices.

§

RgbLightStrip

Tapo L900 devices.

Fields

§device_info: Box<DeviceInfoRgbLightStripResult>

Device info of Tapo L900.

§handler: RgbLightStripHandler

Handler for the L900 devices.

§

RgbicLightStrip

Tapo L920 and L930 devices.

Fields

§device_info: Box<DeviceInfoRgbicLightStripResult>

Device info of Tapo L920 and L930.

§handler: RgbicLightStripHandler

Handler for the L920 and L930 devices.

§

Plug

Tapo P100 and P105 devices.

Fields

§device_info: Box<DeviceInfoPlugResult>

Device info of Tapo P100 and P105.

§handler: PlugHandler

Handler for the P100 and P105 devices.

§

PlugEnergyMonitoring

Tapo P110, P110M and P115 devices.

Fields

§device_info: Box<DeviceInfoPlugEnergyMonitoringResult>

Device info of Tapo P110, P110M and P115.

§handler: PlugEnergyMonitoringHandler

Handler for the P110, P110M and P115 devices.

§

PowerStrip

Tapo P300 and P306 devices.

Fields

§device_info: Box<DeviceInfoPowerStripResult>

Device info of Tapo P300 and P306.

§handler: PowerStripHandler

Handler for the P300 and P306 devices.

§

PowerStripEnergyMonitoring

Tapo P304M and P316M devices.

Fields

§device_info: Box<DeviceInfoPowerStripResult>

Device info of Tapo P304M and P316M.

§handler: PowerStripEnergyMonitoringHandler

Handler for the P304M and P316M devices.

§

Hub

Tapo H100 devices.

Fields

§device_info: Box<DeviceInfoHubResult>

Device info of Tapo H100.

§handler: HubHandler

Handler for the H100 devices.

Implementations§

Source§

impl DiscoveryResult

Source

pub fn device_type(&self) -> DeviceType

Returns the DeviceType category of this discovery result.

Source

pub fn model(&self) -> &str

Returns the model string (e.g. “L530”, “P110”).

Source

pub fn ip(&self) -> &str

Returns the IP address of the device.

Source

pub fn device_id(&self) -> &str

Returns the device ID.

Source

pub fn nickname(&self) -> &str

Returns the device nickname.

PowerStrip variants lack a nickname field, so a descriptive literal is returned instead.

Trait Implementations§

Source§

impl Debug for DiscoveryResult

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> 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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