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 IP address of the bridge.
Modifies the configuration of the bridge.
Returns the configuration of the bridge.
pub fn set_light_attribute<S>(
&self,
id: S,
modifier: &AttributeModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
pub fn set_light_attribute<S>(
&self,
id: S,
modifier: &AttributeModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
Modifies attributes of a light.
pub fn set_light_state<S>(
&self,
id: S,
modifier: &StateModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
pub fn set_light_state<S>(
&self,
id: S,
modifier: &StateModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
Modifies the state of 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.
pub fn set_group_attribute<S>(
&self,
id: S,
modifier: &AttributeModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
pub fn set_group_attribute<S>(
&self,
id: S,
modifier: &AttributeModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
Modifies attributes of a group.
pub fn set_group_state<S>(
&self,
id: S,
modifier: &StateModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
pub fn set_group_state<S>(
&self,
id: S,
modifier: &StateModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
Modifies the state of a group.
Returns all groups.
Deletes a group from the bridge.
Creates a new scene.
Modifies the state and attributes of a scene.
Returns all scenes.
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.
pub fn set_sensor_attribute<S>(
&self,
id: S,
modifier: &AttributeModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
pub fn set_sensor_attribute<S>(
&self,
id: S,
modifier: &AttributeModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
Modifies attributes of a sensor.
pub fn set_sensor_state<S>(
&self,
id: S,
modifier: &StateModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
pub fn set_sensor_state<S>(
&self,
id: S,
modifier: &StateModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
Modifies the state of a sensor.
pub fn set_sensor_config<S>(
&self,
id: S,
modifier: &ConfigModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
pub fn set_sensor_config<S>(
&self,
id: S,
modifier: &ConfigModifier
) -> Result<Vec<Response<Modified>>> where
S: Into<String>,
Modifies the configuration of 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 all rules.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Bridge
impl UnwindSafe for Bridge
Blanket Implementations
Mutably borrows from an owned value. Read more