mirror of
https://github.com/esphome/esphome.git
synced 2026-09-13 16:18:41 +00:00
cfb6c4e9d4e5f7bc56680731ac9b4646d8744a95
The two_byte_to_int() function used `char` parameters instead of `uint8_t`, causing sign extension for byte values >= 0x80. This produced incorrect sensor values for distances where value % 256 >= 128 (e.g. 128cm reported as -128, 200cm reported as -56). Changed return type to uint16_t to match protocol spec (unsigned distances), renamed to two_byte_to_uint16, and moved to shared ld24xx header to eliminate duplication.
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
593 MiB
Languages
C++
55.8%
Python
43.6%
C
0.3%
JavaScript
0.2%
