[][src]Struct philipshue_edj::bridge::Bridge

pub struct Bridge { /* fields omitted */ }

The bridge connection

Methods

impl Bridge[src]

pub fn new<S: Into<String>, U: Into<String>>(ip: S, username: U) -> Self[src]

Creates a Bridge on the given IP with the given username

pub fn get_ip(&self) -> &str[src]

Gets the IP of bridge

pub fn get_username(&self) -> &str[src]

Gets the username this Bridge uses

pub fn get_all_lights(&self) -> Result<BTreeMap<usize, Light>>[src]

Gets all lights that are connected to the bridge

pub fn get_light(&self, id: usize) -> Result<Light>[src]

Gets the light with the specific id

pub fn get_new_lights(&self) -> Result<BTreeMap<usize, Light>>[src]

Gets all the light that were found last time a search for new lights was done

pub fn search_for_new_lights(&self) -> Result<SuccessVec>[src]

Makes the bridge search for new lights (and switches).

The found lights can be retrieved with get_new_lights()

pub fn set_light_state(
    &self,
    id: usize,
    command: &LightCommand
) -> Result<SuccessVec>
[src]

Sets the state of a light by sending a LightCommand to the bridge for this light

pub fn rename_light(&self, id: usize, name: String) -> Result<SuccessVec>[src]

Renames the light

pub fn delete_light(&self, id: usize) -> Result<SuccessVec>[src]

Deletes a light from the bridge

pub fn get_all_groups(&self) -> Result<BTreeMap<usize, Group>>[src]

Gets all groups of the bridge

pub fn create_group(
    &self,
    name: String,
    lights: Vec<usize>,
    group_type: GroupType,
    room_class: Option<RoomClass>
) -> Result<usize>
[src]

Creates a group and returns the ID of the group

pub fn get_group_attributes(&self, id: usize) -> Result<Group>[src]

Gets extra information about a specific group

pub fn set_group_attributes(
    &self,
    id: usize,
    attr: &GroupCommand
) -> Result<SuccessVec>
[src]

Set the name, light and class of a group

pub fn set_group_state(
    &self,
    id: usize,
    state: &LightCommand
) -> Result<SuccessVec>
[src]

Sets the state of all lights in the group.

ID 0 is a sepcial group containing all lights known to the bridge

pub fn delete_group(&self, id: usize) -> Result<Vec<String>>[src]

Deletes the specified group

It's not allowed to delete groups of type LightSource or Luminaire.

pub fn get_configuration(&self) -> Result<Configuration>[src]

Returns detailed information about the configuration of the bridge.

pub fn modify_configuration(
    &self,
    command: &ConfigurationModifier
) -> Result<SuccessVec>
[src]

Sets some configuration values.

pub fn delete_user(&self, username: &str) -> Result<Vec<String>>[src]

Deletes the specified user removing them from the whitelist.

pub fn get_full_state(&self) -> Result<FullState>[src]

Fetches the entire datastore from the bridge.

This is a resource intensive command for the bridge, and should therefore be used sparingly.

pub fn recall_scene_in_group(
    &self,
    group_id: usize,
    scene_id: &str
) -> Result<SuccessVec>
[src]

Sets the state of lights in the group to the state in the scene

Note that this will affect that are both in the group and in the scene. Using group 0 will set all the lights in the scene, since group 0 is a special group that contains all lights

pub fn get_all_scenes(&self) -> Result<BTreeMap<String, Scene>>[src]

Gets all scenes of the bridge

pub fn create_scene(&self, scene: &SceneCreater) -> Result<String>[src]

Creates a scene on the bridge and returns the ID of the created scene.

pub fn modify_scene(
    &self,
    id: &str,
    scene: &SceneModifier
) -> Result<SuccessVec>
[src]

Sets general things in the specified scene

pub fn set_light_state_in_scene(
    &self,
    scene_id: &str,
    light_id: usize,
    state: &LightStateChange
) -> Result<SuccessVec>
[src]

Sets the light state of the specified ID that is stored in the scene

pub fn delete_scene(&self, id: &str) -> Result<Vec<String>>[src]

Deletes the specified scene

pub fn get_scene_with_states(&self, id: &str) -> Result<Scene>[src]

Gets the scene with the specified ID with its lightstates

Trait Implementations

impl Debug for Bridge[src]

Auto Trait Implementations

impl Send for Bridge

impl Sync for Bridge

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.