mirror of
https://github.com/esphome/esphome.git
synced 2026-05-20 01:16:26 +08:00
[tormatic] Use .value() for checked optional access in read_gate_status_ (#16121)
This commit is contained in:
@@ -282,12 +282,13 @@ optional<GateStatus> Tormatic::read_gate_status_() {
|
||||
}
|
||||
}
|
||||
|
||||
auto hdr = this->pending_hdr_.value();
|
||||
|
||||
// Wait for all payload bytes to arrive before processing.
|
||||
if (this->available() < this->pending_hdr_->payload_size()) {
|
||||
if (this->available() < hdr.payload_size()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto hdr = *this->pending_hdr_;
|
||||
this->pending_hdr_.reset();
|
||||
|
||||
switch (hdr.type) {
|
||||
|
||||
Reference in New Issue
Block a user