pub struct EspHomeApi { /* private fields */ }
Implementations§
Source§impl EspHomeApi
impl EspHomeApi
Sourcepub fn builder() -> EspHomeApiBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> EspHomeApiBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building EspHomeApi
.
On the builder, call .password_authenticated(...)
(optional), .key_authenticated(...)
(optional), .encrypted_api(...)
(optional), .encryption_state(...)
(optional), .name(...)
, .password(...)
(optional), .encryption_key(...)
(optional), .api_version_major(...)
(optional), .api_version_minor(...)
(optional), .server_info(...)
(optional), .friendly_name(...)
(optional), .mac(...)
(optional), .model(...)
(optional), .manufacturer(...)
(optional), .suggested_area(...)
(optional), .bluetooth_mac_address(...)
(optional), .project_name(...)
(optional), .project_version(...)
(optional), .compilation_time(...)
(optional), .legacy_bluetooth_proxy_version(...)
(optional), .bluetooth_proxy_feature_flags(...)
(optional), .legacy_voice_assistant_version(...)
(optional), .voice_assistant_feature_flags(...)
(optional), .esphome_version(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of EspHomeApi
.
Source§impl EspHomeApi
Handles the EspHome Api, with encryption etc.
impl EspHomeApi
Handles the EspHome Api, with encryption etc.
Sourcepub async fn start(
&mut self,
tcp_stream: TcpStream,
) -> Result<(Sender<ProtoMessage>, Receiver<ProtoMessage>), Box<dyn Error>>
pub async fn start( &mut self, tcp_stream: TcpStream, ) -> Result<(Sender<ProtoMessage>, Receiver<ProtoMessage>), Box<dyn Error>>
Starts the server and returns a broadcast channel for messages, and a broadcast receiver for all messages not handled by the abstraction