From 90e0ea41c2f5bdfb3d9d051bd114aef4150bcef5 Mon Sep 17 00:00:00 2001 From: SzczepanLeon <75840303+SzczepanLeon@users.noreply.github.com> Date: Sat, 13 Jan 2024 19:37:50 +0100 Subject: [PATCH] experimental support for Apator E-ITN 40 --- driver_apatoreitn.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/driver_apatoreitn.h b/driver_apatoreitn.h index 447beb9..84bcd3d 100755 --- a/driver_apatoreitn.h +++ b/driver_apatoreitn.h @@ -32,10 +32,16 @@ struct ApatorEITN: Driver esphome::optional get_current_hca(std::vector &telegram) { esphome::optional ret_val{}; size_t i = 10; + if (telegram[i] == 0xB6) { i += telegram[i+1] + 2; } + // experimental Apator E-ITN 40 + if ((telegram[8] == 0x09) && (telegram.size() > 40)) { + i = 43; + } + ret_val = (((uint32_t)telegram[i+9] << 8) + (uint32_t)telegram[i+8]); return ret_val; @@ -64,4 +70,4 @@ struct ApatorEITN: Driver return ret_val; }; -}; \ No newline at end of file +};