mirror of
https://github.com/esphome/esphome.git
synced 2025-09-26 15:12:21 +01:00
Reduce duplicate code in API to check auth and connection
This commit is contained in:
@@ -827,7 +827,7 @@ class ProtoService {
|
||||
}
|
||||
|
||||
// Authentication helper methods
|
||||
bool check_connection_setup_() {
|
||||
inline bool check_connection_setup_() {
|
||||
if (!this->is_connection_setup()) {
|
||||
this->on_no_setup_connection();
|
||||
return false;
|
||||
@@ -835,7 +835,7 @@ class ProtoService {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool check_authenticated_() {
|
||||
inline bool check_authenticated_() {
|
||||
#ifdef USE_API_PASSWORD
|
||||
if (!this->check_connection_setup_()) {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user