mirror of
https://github.com/esphome/esphome.git
synced 2026-06-01 01:19:45 +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.
|
// Wait for all payload bytes to arrive before processing.
|
||||||
if (this->available() < this->pending_hdr_->payload_size()) {
|
if (this->available() < hdr.payload_size()) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
auto hdr = *this->pending_hdr_;
|
|
||||||
this->pending_hdr_.reset();
|
this->pending_hdr_.reset();
|
||||||
|
|
||||||
switch (hdr.type) {
|
switch (hdr.type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user