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

Introduce encode_value/decode_value() template functions (#2662)

This commit is contained in:
Oxan van Leeuwen
2021-11-10 19:44:01 +01:00
committed by GitHub
parent 4d43396835
commit 99c775d8cb
3 changed files with 36 additions and 19 deletions

View File

@@ -52,7 +52,7 @@ void CCS811Component::setup() {
if (this->baseline_.has_value()) {
// baseline available, write to sensor
this->write_bytes(0x11, decode_uint16(*this->baseline_));
this->write_bytes(0x11, decode_value(*this->baseline_));
}
auto hardware_version_data = this->read_bytes<1>(0x21);