[][src]Struct dss::RawApi

pub struct RawApi { /* fields omitted */ }

Raw interface towards the DSS-Rest service. This is not intend to be used directly from a API consumer. It misses important status management and abstraction over the different devices.

Methods

impl RawApi[src]

pub fn connect<S>(host: S, user: S, password: S) -> Result<Self, Error> where
    S: Into<String>, 
[src]

Connect to the Digital Strom Server and try to login.

pub fn generic_request<S>(
    &self,
    request: S,
    parameter: Option<Vec<(&str, &str)>>
) -> Result<Value, Error> where
    S: Into<String>, 
[src]

Generic requset function, which handles the token inserting/login, the json parsing and success check.

It returns a json value, dependet on the request.

pub fn new_event_channel(
    &self
) -> Result<(Receiver<Event>, Arc<Mutex<bool>>), Error>
[src]

Create a new event channel, which is listinging to events from the dss station.

pub fn get_appartement_name(&self) -> Result<String, Error>[src]

Receive the appartement name.

pub fn set_appartement_name<S>(&self, new_name: S) -> Result<bool, Error> where
    S: Into<String>, 
[src]

Set the appartement name within the DSS.

pub fn get_zones(&self) -> Result<Vec<Zone>, Error>[src]

Request all zones from the DSS system.

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

Get the name of a specific zone from the DSS system.

pub fn get_devices(&self) -> Result<Vec<Device>, Error>[src]

Receive all devices availble in the appartement.

pub fn get_device_scene_mode<S>(
    &self,
    device: S,
    scene_id: usize
) -> Result<SceneMode, Error> where
    S: Into<String>, 
[src]

Request the scene mode for a specific device.

pub fn get_circuits(&self) -> Result<Vec<Circut>, Error>[src]

Get all available circuts

pub fn get_scenes(&self, zone: usize, typ: Type) -> Result<Vec<usize>, Error>[src]

Get all available scenes for a specific zone with a type.

pub fn get_last_called_scene(
    &self,
    zone: usize,
    typ: Type
) -> Result<usize, Error>
[src]

Return the last called scene for a zone.

pub fn call_scene(
    &self,
    zone: usize,
    typ: Type,
    scene: usize
) -> Result<(), Error>
[src]

Trigger a scene for a specific zone and type in the dss system.

pub fn call_action(&self, zone: usize, action: Action) -> Result<(), Error>[src]

Transforms a action to a scene call if possible and executes it

pub fn get_shadow_device_open<S>(&self, device: S) -> Result<f32, Error> where
    S: Into<String>, 
[src]

Get the opening status of a single shadow device and resturns it.

pub fn set_shadow_device_open<S>(
    &self,
    device: S,
    value: f32
) -> Result<(), Error> where
    S: Into<String>, 
[src]

Set the shadow opening for a single device

pub fn get_shadow_device_angle<S>(&self, device: S) -> Result<f32, Error> where
    S: Into<String>, 
[src]

Get the shadow open angle for a single device.

pub fn set_shadow_device_angle<S>(
    &self,
    device: S,
    value: f32
) -> Result<(), Error> where
    S: Into<String>, 
[src]

Set the shade open angle for a single device

Trait Implementations

impl Clone for RawApi[src]

impl Debug for RawApi[src]

Auto Trait Implementations

impl RefUnwindSafe for RawApi

impl Send for RawApi

impl Sync for RawApi

impl Unpin for RawApi

impl UnwindSafe for RawApi

Blanket Implementations

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

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

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

impl<T> Erased for T

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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, U> TryInto<U> for T where
    U: TryFrom<T>, 

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