Struct wemo::Switch [] [src]

pub struct Switch {
    pub serial_number: Option<String>,
    // some fields omitted
}

Represents a Wemo Switch device.

Fields

The device's unique serial number.

Methods

impl Switch
[src]

Functions for WeMo Switch.

Deprecated since 0.0.11

Switch CTOR.

Construct a device that lives behind a static IP address. We won't need to issue later SSDP searches to find or relocate the device.

Also include port (ports are subject to change).

Construct a device that lives behind a static IP address. We may need to relocate this device later if it changes IP by issuing SSDP searches.

Also include port (ports are subject to change).

Deprecated since 0.0.11

Switch CTOR.

Deprecated since 0.0.11

Switch CTOR.

Turn the device on.

Turn the device on.

Turn the device off.

Turn the device off.

Toggle the device on or off.

Toggle the device on or off.

Get the current state of the device.

Set the current state of the device.

Returns the static IP if the Wemo was configured with a static IP, otherwise returns the last cached IP address (which may not be set).

Get the currently known port. If we haven't manually set the port or talked to the Wemo device yet, the port will not be set.

Attempt to find the Switch on the network via SSDP. Both the IP address and port will be updated if they changed. (The IP address will not be updated if the device is configured to use a static IP.)

Return the IP/port, name, or other identifier for logging. Not a useful format for converting into a URL.

Trait Implementations

impl Display for Switch
[src]

Formats the value using the given formatter. Read more