[−][src]Struct homeassistent::HomeAssistantAPI
Implementations
impl HomeAssistantAPI
[src]
pub fn new(
instance_url: String,
client_id: String,
maybe_long_lived_token: Option<String>
) -> Self
[src]
instance_url: String,
client_id: String,
maybe_long_lived_token: Option<String>
) -> Self
pub fn set_oauth_token(
&mut self,
access_token: String,
expires_in: u32,
refresh_token: String
)
[src]
&mut self,
access_token: String,
expires_in: u32,
refresh_token: String
)
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]
&mut self,
webhook_id: String,
cloudhook_url: Option<String>,
remote_ui_url: Option<String>
)
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]
&'_ mut self,
code: String,
client_id: String
) -> Result<GetAccessTokenResponse, Error>
pub async fn api_states<'_>(&'_ self) -> Result<Vec<HaEntityState>, Error>
[src]
pub async fn register_machine<'_, '_>(
&'_ mut self,
request: &'_ RegisterDeviceRequest
) -> Result<RegisterDeviceResponse, Error>
[src]
&'_ mut self,
request: &'_ RegisterDeviceRequest
) -> Result<RegisterDeviceResponse, Error>
pub async fn register_sensor<'_, '_>(
&'_ mut self,
request: &'_ SensorRegistrationRequest
) -> Result<RegisterSensorResponse, Error>
[src]
&'_ mut self,
request: &'_ SensorRegistrationRequest
) -> Result<RegisterSensorResponse, Error>
pub async fn update_sensor<'_>(
&'_ mut self,
sensor_data: SensorUpdateData
) -> Result<(), Error>
[src]
&'_ mut self,
sensor_data: SensorUpdateData
) -> Result<(), Error>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for HomeAssistantAPI
impl Send for HomeAssistantAPI
impl Sync for HomeAssistantAPI
impl Unpin for HomeAssistantAPI
impl !UnwindSafe for HomeAssistantAPI
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,