1
0
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:
J. Nick Koston
2025-09-23 11:47:38 -05:00
parent 3b20969171
commit 43cfdb7919
4 changed files with 147 additions and 191 deletions

View File

@@ -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;