Po wielu miesiącach (czy raczej latach) wykryto błąd w kodzie, chyba przy okazji rozwoju nowych komponentów wyświetlaczy
rok 2026
2026.1.0 warto czytać - istotne zmiany, m.in. framework Arduino przestał być domyślny dla wielu platform sprzętowych, zmiany w API i OTA
2026.2.0 warto czytać - istotne zmiany
2026.3.0 - istotne zmiany w popularnych komponentach Time, OpenTherm, Speaker Media Player i w mniej popularnych SGP30, ESP32-P4
2026.4.0 - ESP32 CPU frequency, … i wiele innych
i taki mój mały prywatny komentarz, radzę poczekać na jakieś nowsze wersje od 2026.4.0, gdzie zostaną naprawione błędy, bo …
dev ← swoboda1337:misc-bugfixes-2
otwarty 03:27PM - 18 Mar 26 UTC
## What does this implement/fix?
Four bugfixes found during a systematic compon… ent review:
### 1. [vbus] Fix integer overflow in heat quantity and value calculations
- `get_u16() * 1000000` overflows `int` when the MWh register is >= 3 (realistic for solar thermal systems running for years). Changed to float literals (`1000.0f`, `1000000.0f`) matching how `DeltaSolBS2Sensor` already does it correctly.
- `get_u16() << 16` promotes `uint16_t` to `int`, causing signed overflow UB when bit 15 is set (value >= 32768). Cast to `uint32_t` before shifting. Affects DeltaSolCS2, CS4, and CSPlus sensors.
- Same `<< 24` overflow fix in `vbus.cpp` protocol parser.
### 2. [shelly_dimmer] Fix off-by-one in poll response length check
The check requires `payload_len >= 16` (valid indices 0-15), but `payload[16]` (fade_rate) is accessed on line 419. Changed to require `>= 17`.
### 3. [st7789v] Fix swapped width/height offsets in display data
`offset_height_` was applied to the x (column) axis and `offset_width_` to the y (row) axis. Swapped so the width offset applies to columns and height offset applies to rows.
### 4. [modbus_controller] Fix signed overflow in mask_and_shift_by_rightbit
`1 << pos` uses `int` (signed 32-bit). When `pos` is 31 and `N` is `uint32_t`, this shifts into the sign bit — undefined behavior. Cast the literal to the template type `N` before shifting.
## Types of changes
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Developer breaking change (an API change that could break external components)
- [ ] Undocumented C++ API change (removal or change of undocumented public methods that lambda users may depend on)
- [ ] Code quality improvements to existing code or addition of tests
- [ ] Other
**Related issue or feature (if applicable):**
- N/A
**Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable):**
- N/A
## Test Environment
- [x] ESP32
- [x] ESP32 IDF
- [x] ESP8266
- [ ] RP2040/RP2350
- [ ] BK72xx
- [ ] RTL87xx
- [ ] LN882x
- [ ] nRF52840
## Example entry for `config.yaml`:
```yaml
# No config changes needed for any of these fixes.
```
## Checklist:
- [x] The code change is tested and works locally.
- [x] Tests have been added to verify that the new code works (under `tests/` folder).
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated in [esphome-docs](https://github.com/esphome/esphome-docs).
de facto platforma st7789v jest już od bardzo dawna przestarzała (bardzo długi czas zastępowała ją platforma ili9xxx, ale i ona jest zaplanowana do wycofania - akurat używam wyświetlaczy na bazie kontrolera Sitronix ST7789V u siebie i migrowałem 2x, a tam gdzie przegapiłem “panowanie” ili9xxx to tylko raz :P), więc zalecam wyjście krok wprzód i zmianę na taką, która będzie wspierana w przyszłości, czyli mipi_spi (szczególnie jeśli migrowałeś z frameworka arduino na esp-idf).
Migracja YAMLa nie jest jakimś hardkorem, więc chyba warto go unowocześnić.
(a dla wielu modeli popularnych wyświetlaczy są częściowe lub całkowite gotowce jako definicje modeli, też kiedyś musiałem używać offsety, a teraz mam to w 1 linijce jako konkretny model wyświetlacza;
jakkolwiek nie dotyczy to definicji połączeń kontrolera SPI, ale do tego wykorzystasz to co masz, bo w sprzęcie się nic Ci nie zmienia)