pub struct HomeAssistantAPI { /* private fields */ }
Implementations§
Source§impl HomeAssistantAPI
impl HomeAssistantAPI
pub fn new( 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, )
pub fn set_long_lived_token(&mut self, token: String)
pub fn set_webhook_info( &mut self, webhook_id: String, cloudhook_url: Option<String>, remote_ui_url: Option<String>, )
pub fn need_refresh(&self) -> bool
pub async fn refresh_token(&mut self) -> Result<(), Error>
pub async fn access_token( &mut self, code: String, client_id: String, ) -> Result<GetAccessTokenResponse, Error>
pub async fn api_states(&self) -> Result<Vec<HaEntityState>, Error>
pub async fn register_machine( &mut self, request: &RegisterDeviceRequest, ) -> Result<RegisterDeviceResponse, Error>
pub async fn register_sensor( &mut self, request: &SensorRegistrationRequest, ) -> Result<RegisterSensorResponse, Error>
pub async fn update_sensor( &mut self, sensor_data: SensorUpdateData, ) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HomeAssistantAPI
impl !RefUnwindSafe for HomeAssistantAPI
impl Send for HomeAssistantAPI
impl Sync for HomeAssistantAPI
impl Unpin for HomeAssistantAPI
impl !UnwindSafe for HomeAssistantAPI
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more