From 2a761a7261b1ce4a93f7dd431e6604c21f232769 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Thu, 1 Jun 2023 02:56:26 +0300 Subject: pio/temphum: fix --- platformio/common/libs/temphum/homekit/temphum.cpp | 4 +++- platformio/common/libs/temphum/library.json | 2 +- 2 files changed, 4 insertions(+), 2 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 +} diff --git a/platformio/common/libs/temphum/library.json b/platformio/common/libs/temphum/library.json index ae7f670..329b7ca 100644 --- a/platformio/common/libs/temphum/library.json +++ b/platformio/common/libs/temphum/library.json @@ -1,6 +1,6 @@ { "name": "homekit_temphum", - "version": "1.0.2", + "version": "1.0.3", "build": { "flags": "-I../../include" } -- cgit v1.2.3