mirror of
https://github.com/esphome/esphome.git
synced 2025-07-30 15:16:37 +00:00
fixes
This commit is contained in:
parent
693208a9f3
commit
542fd6c6ca
@ -1407,21 +1407,19 @@ bool APIConnection::send_hello_response(const HelloRequest &msg) {
|
|||||||
|
|
||||||
return this->send_message(resp, HelloResponse::MESSAGE_TYPE);
|
return this->send_message(resp, HelloResponse::MESSAGE_TYPE);
|
||||||
}
|
}
|
||||||
bool APIConnection::send_connect_response(const ConnectRequest &msg) {
|
|
||||||
bool correct = true;
|
|
||||||
#ifdef USE_API_PASSWORD
|
#ifdef USE_API_PASSWORD
|
||||||
correct = this->parent_->check_password(msg.password);
|
bool APIConnection::send_connect_response(const ConnectRequest &msg) {
|
||||||
#endif
|
bool correct = this->parent_->check_password(msg.password);
|
||||||
|
|
||||||
ConnectResponse resp;
|
ConnectResponse resp;
|
||||||
// bool invalid_password = 1;
|
// bool invalid_password = 1;
|
||||||
resp.invalid_password = !correct;
|
resp.invalid_password = !correct;
|
||||||
if (correct) {
|
if (this->parent_->check_password(msg.password)) {
|
||||||
this->complete_authentication_();
|
this->complete_authentication_();
|
||||||
}
|
}
|
||||||
return this->send_message(resp, ConnectResponse::MESSAGE_TYPE);
|
return this->send_message(resp, ConnectResponse::MESSAGE_TYPE);
|
||||||
}
|
}
|
||||||
|
#endif // USE_API_PASSWORD
|
||||||
bool APIConnection::send_ping_response(const PingRequest &msg) {
|
bool APIConnection::send_ping_response(const PingRequest &msg) {
|
||||||
PingResponse resp;
|
PingResponse resp;
|
||||||
return this->send_message(resp, PingResponse::MESSAGE_TYPE);
|
return this->send_message(resp, PingResponse::MESSAGE_TYPE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user