1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-26 23:22:21 +01:00

[api] Add missing USE_API_PASSWORD guards to reduce flash usage (#9899)

This commit is contained in:
J. Nick Koston
2025-07-25 20:21:09 -10:00
committed by GitHub
parent 11f970edec
commit da491f7090
3 changed files with 10 additions and 0 deletions

View File

@@ -860,7 +860,9 @@ class ProtoService {
virtual bool is_authenticated() = 0;
virtual bool is_connection_setup() = 0;
virtual void on_fatal_error() = 0;
#ifdef USE_API_PASSWORD
virtual void on_unauthenticated_access() = 0;
#endif
virtual void on_no_setup_connection() = 0;
/**
* Create a buffer with a reserved size.
@@ -898,6 +900,7 @@ class ProtoService {
}
bool check_authenticated_() {
#ifdef USE_API_PASSWORD
if (!this->check_connection_setup_()) {
return false;
}
@@ -906,6 +909,9 @@ class ProtoService {
return false;
}
return true;
#else
return this->check_connection_setup_();
#endif
}
};