Struct huelib::bridge::Bridge[][src]

pub struct Bridge { /* fields omitted */ }
Expand description

A bridge with IP address and username.

Implementations

Creates a new bridge.

Examples

Create a bridge with an already registered user:

use huelib::Bridge;
use std::net::{IpAddr, Ipv4Addr};

let ip = IpAddr::V4(Ipv4Addr::new(192, 168, 1, 2));
let bridge = Bridge::new(ip, "username");

Returns the name of the user that is connected to the bridge.

Returns the IP address of the bridge.

Modifies the configuration of the bridge.

Returns the configuration of the bridge.

Modifies attributes of a light.

Modifies the state of a light.

Returns a light.

Returns all lights that are connected to the bridge.

Starts searching for new lights.

The bridge will open the network for 40 seconds. The overall search might take longer since the configuration of new devices can take longer. If many devices are found the command will have to be issued a second time after discovery time has elapsed. If the command is received again during search the search will continue for at least an additional 40 seconds.

When the search has finished, new lights will be available using the get_new_lights function.

Returns discovered lights.

Deletes a light from the bridge.

Creates a new group.

Modifies attributes of a group.

Modifies the state of a group.

Returns a group.

Returns all groups.

Deletes a group from the bridge.

Creates a new scene.

Modifies the state and attributes of a scene.

Returns a scene.

Returns all scenes.

Deletes a scene.

Returns the capabilities of resources.

Creates a new schedule and returns the identifier.

Modifies attributes of a schedule.

Returns a schedule.

Returns all schedules.

Deletes a schedule.

Creates a new resourcelink and returns the identifier.

Modifies attributes of a resourcelink.

Returns a resourcelink.

Returns all resourcelinks.

Deletes a resourcelink.

Modifies attributes of a sensor.

Modifies the state of a sensor.

Modifies the configuration of a sensor.

Returns a sensor.

Returns all sensors that are connected to the bridge.

Starts searching for new sensors.

The bridge will open the network for 40 seconds. The overall search might take longer since the configuration of new devices can take longer. If many devices are found the command will have to be issued a second time after discovery time has elapsed. If the command is received again during search the search will continue for at least an additional 40 seconds.

When the search has finished, new sensors will be available using the get_new_sensors function.

Returns discovered sensors.

Deletes a sensor from the bridge.

Creates a new rule.

Modifies attributes of a rule.

Returns a rule.

Returns all rules.

Deletes a rule.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.