Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.rest.data.RestData Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass, str method, str resource, str encoding, httpx.DigestAuth|tuple[str, str]|None auth, dict[str, str]|None headers, dict[str, str]|None params, str|None data, bool verify_ssl, str ssl_cipher_list, int timeout=DEFAULT_TIMEOUT)
 
None async_update (self, bool log_errors=True)
 
str|None data_without_xml (self)
 
None set_payload (self, str payload)
 
None set_url (self, str url)
 
str url (self)
 

Public Attributes

 data
 
 headers
 
 last_exception
 

Private Attributes

 _async_client
 
 _auth
 
 _encoding
 
 _hass
 
 _headers
 
 _method
 
 _params
 
 _request_data
 
 _resource
 
 _ssl_cipher_list
 
 _timeout
 
 _verify_ssl
 

Detailed Description

Class for handling the data retrieval.

Definition at line 24 of file data.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.rest.data.RestData.__init__ (   self,
HomeAssistant  hass,
str  method,
str  resource,
str  encoding,
httpx.DigestAuth | tuple[str, str] | None  auth,
dict[str, str] | None  headers,
dict[str, str] | None  params,
str | None  data,
bool  verify_ssl,
str  ssl_cipher_list,
int   timeout = DEFAULT_TIMEOUT 
)
Initialize the data object.

Definition at line 27 of file data.py.

Member Function Documentation

◆ async_update()

None homeassistant.components.rest.data.RestData.async_update (   self,
bool   log_errors = True 
)
Get the latest data from REST service with provided method.

Definition at line 85 of file data.py.

◆ data_without_xml()

str | None homeassistant.components.rest.data.RestData.data_without_xml (   self)
If the data is an XML string, convert it to a JSON string.

Definition at line 71 of file data.py.

◆ set_payload()

None homeassistant.components.rest.data.RestData.set_payload (   self,
str  payload 
)
Set request data.

Definition at line 58 of file data.py.

◆ set_url()

None homeassistant.components.rest.data.RestData.set_url (   self,
str  url 
)
Set url.

Definition at line 67 of file data.py.

◆ url()

str homeassistant.components.rest.data.RestData.url (   self)
Get url.

Definition at line 63 of file data.py.

Member Data Documentation

◆ _async_client

homeassistant.components.rest.data.RestData._async_client
private

Definition at line 88 of file data.py.

◆ _auth

homeassistant.components.rest.data.RestData._auth
private

Definition at line 46 of file data.py.

◆ _encoding

homeassistant.components.rest.data.RestData._encoding
private

Definition at line 45 of file data.py.

◆ _hass

homeassistant.components.rest.data.RestData._hass
private

Definition at line 42 of file data.py.

◆ _headers

homeassistant.components.rest.data.RestData._headers
private

Definition at line 47 of file data.py.

◆ _method

homeassistant.components.rest.data.RestData._method
private

Definition at line 43 of file data.py.

◆ _params

homeassistant.components.rest.data.RestData._params
private

Definition at line 48 of file data.py.

◆ _request_data

homeassistant.components.rest.data.RestData._request_data
private

Definition at line 49 of file data.py.

◆ _resource

homeassistant.components.rest.data.RestData._resource
private

Definition at line 44 of file data.py.

◆ _ssl_cipher_list

homeassistant.components.rest.data.RestData._ssl_cipher_list
private

Definition at line 52 of file data.py.

◆ _timeout

homeassistant.components.rest.data.RestData._timeout
private

Definition at line 50 of file data.py.

◆ _verify_ssl

homeassistant.components.rest.data.RestData._verify_ssl
private

Definition at line 51 of file data.py.

◆ data

homeassistant.components.rest.data.RestData.data

Definition at line 110 of file data.py.

◆ headers

homeassistant.components.rest.data.RestData.headers

Definition at line 111 of file data.py.

◆ last_exception

homeassistant.components.rest.data.RestData.last_exception

Definition at line 115 of file data.py.


The documentation for this class was generated from the following file: