Skip to content

Commit

Permalink
experimental support for Apator E-ITN 40
Browse files Browse the repository at this point in the history
  • Loading branch information
SzczepanLeon authored Jan 13, 2024
1 parent 9c1c902 commit 90e0ea4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion driver_apatoreitn.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ struct ApatorEITN: Driver
esphome::optional<double> get_current_hca(std::vector<unsigned char> &telegram) {
esphome::optional<double> 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;
Expand Down Expand Up @@ -64,4 +70,4 @@ struct ApatorEITN: Driver

return ret_val;
};
};
};

0 comments on commit 90e0ea4

Please sign in to comment.