From b6bb6699d1de62ce302a7b3931e52a39844b6cc7 Mon Sep 17 00:00:00 2001 From: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com> Date: Wed, 27 Aug 2025 19:30:01 +1000 Subject: [PATCH] [mipi_spi] Fix dimensions (#10443) --- esphome/components/mipi/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/esphome/components/mipi/__init__.py b/esphome/components/mipi/__init__.py index f610f160b0..570a021cff 100644 --- a/esphome/components/mipi/__init__.py +++ b/esphome/components/mipi/__init__.py @@ -309,8 +309,12 @@ class DriverChip: CONF_NATIVE_HEIGHT, height + offset_height * 2 ) offset_height = native_height - height - offset_height - # Swap default dimensions if swap_xy is set - if transform[CONF_SWAP_XY] is True: + # Swap default dimensions if swap_xy is set, or if rotation is 90/270 and we are not using a buffer + rotated = not requires_buffer(config) and config.get(CONF_ROTATION, 0) in ( + 90, + 270, + ) + if transform[CONF_SWAP_XY] is True or rotated: width, height = height, width offset_height, offset_width = offset_width, offset_height return width, height, offset_width, offset_height