diff options
Diffstat (limited to 'platformio/common/libs/temphum/homekit/temphum.cpp')
-rw-r--r-- | platformio/common/libs/temphum/homekit/temphum.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platformio/common/libs/temphum/homekit/temphum.cpp b/platformio/common/libs/temphum/homekit/temphum.cpp index ac4d371..e69b3a5 100644 --- a/platformio/common/libs/temphum/homekit/temphum.cpp +++ b/platformio/common/libs/temphum/homekit/temphum.cpp @@ -30,6 +30,7 @@ SensorData Si7021::read() { Wire.requestFrom(dev_addr, 2); if (Wire.available() < 2) { PRINTLN("Si7021: 0xf3: could not read 2 bytes"); + error = 1; } uint16_t temp_raw = Wire.read() << 8 | Wire.read(); double temperature = ((175.72 * temp_raw) / 65536.0) - 46.85; @@ -38,6 +39,7 @@ SensorData Si7021::read() { Wire.requestFrom(dev_addr, 2); if (Wire.available() < 2) { PRINTLN("Si7021: 0xf5: could not read 2 bytes"); + error = 1; } uint16_t hum_raw = Wire.read() << 8 | Wire.read(); double humidity = ((125.0 * hum_raw) / 65536.0) - 6.0; @@ -84,4 +86,4 @@ end: return sd; } -}
\ No newline at end of file +} |