Struct philipshue::bridge::Bridge
[−]
[src]
pub struct Bridge { /* fields omitted */ }
The bridge connection
Methods
impl Bridge
[src]
fn new<S: Into<String>, U: Into<String>>(ip: S, username: U) -> Self
Creates a Bridge
on the given IP with the given username
fn get_ip(&self) -> &str
Gets the IP of bridge
fn get_username(&self) -> &str
Gets the username this Bridge
uses
fn get_all_lights(&self) -> Result<Map<usize, Light>, HueError>
Gets all lights that are connected to the bridge
fn get_light(&self, id: usize) -> Result<Light, HueError>
Gets the light with the specific id
fn get_new_lights(&self) -> Result<Map<usize, Light>, HueError>
Gets all the light that were found last time a search for new lights was done
fn search_for_new_lights(&self) -> Result<Vec<HueResponse<Value>>, HueError>
Makes the bridge search for new lights (and switches).
The found lights can be retrieved with get_new_lights()
fn set_light_state(&self,
id: usize,
command: &LightCommand)
-> Result<Vec<HueResponse<Value>>, HueError>
id: usize,
command: &LightCommand)
-> Result<Vec<HueResponse<Value>>, HueError>
Sets the state of a light by sending a LightCommand
to the bridge for this light
fn rename_light(&self,
id: usize,
name: String)
-> Result<Vec<HueResponse<Value>>, HueError>
id: usize,
name: String)
-> Result<Vec<HueResponse<Value>>, HueError>
Renames the light
fn delete_light(&self, id: usize) -> Result<Vec<HueResponse<Value>>, HueError>
Deletes a light from the bridge