[][src]Struct homeassistent::HomeAssistantAPI

pub struct HomeAssistantAPI { /* fields omitted */ }

Implementations

impl HomeAssistantAPI[src]

pub fn new(
    instance_url: String,
    client_id: String,
    maybe_long_lived_token: Option<String>
) -> Self
[src]

pub fn set_oauth_token(
    &mut self,
    access_token: String,
    expires_in: u32,
    refresh_token: String
)
[src]

pub fn set_long_lived_token(&mut self, token: String)[src]

pub fn set_webhook_info(
    &mut self,
    webhook_id: String,
    cloudhook_url: Option<String>,
    remote_ui_url: Option<String>
)
[src]

pub fn need_refresh(&self) -> bool[src]

pub async fn refresh_token<'_>(&'_ mut self) -> Result<(), Error>[src]

pub async fn access_token<'_>(
    &'_ mut self,
    code: String,
    client_id: String
) -> Result<GetAccessTokenResponse, Error>
[src]

pub async fn api_states<'_>(&'_ self) -> Result<Vec<HaEntityState>, Error>[src]

pub async fn register_machine<'_, '_>(
    &'_ mut self,
    request: &'_ RegisterDeviceRequest
) -> Result<RegisterDeviceResponse, Error>
[src]

pub async fn register_sensor<'_, '_>(
    &'_ mut self,
    request: &'_ SensorRegistrationRequest
) -> Result<RegisterSensorResponse, Error>
[src]

pub async fn update_sensor<'_>(
    &'_ mut self,
    sensor_data: SensorUpdateData
) -> Result<(), Error>
[src]

Trait Implementations

impl Debug for HomeAssistantAPI[src]

Auto Trait Implementations

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> From<T> for T[src]

impl<T> Instrument for T[src]

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

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.