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 .first_message_received(...)(optional), .plaintext_communication(...)(optional), .name(...), .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
Trait Implementations§
Source§impl Clone for EspHomeApi
impl Clone for EspHomeApi
Source§fn clone(&self) -> EspHomeApi
fn clone(&self) -> EspHomeApi
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more