From 31ed3068fcf0713873b157e28d0d36248a352d83 Mon Sep 17 00:00:00 2001 From: ghisch <168481965+ghisch@users.noreply.github.com> Date: Thu, 20 Jun 2024 18:41:00 +0200 Subject: [PATCH] Fix KeyError in ESPHome 2024.6.X --- components/mitsubishi_heatpump/climate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/mitsubishi_heatpump/climate.py b/components/mitsubishi_heatpump/climate.py index 93c4e5f..2a908a6 100644 --- a/components/mitsubishi_heatpump/climate.py +++ b/components/mitsubishi_heatpump/climate.py @@ -10,6 +10,7 @@ from esphome.const import ( CONF_MODE, CONF_FAN_MODE, CONF_SWING_MODE, + PLATFORM_ESP8266 ) from esphome.core import CORE, coroutine @@ -63,7 +64,7 @@ CONFIG_SCHEMA = climate.CLIMATE_SCHEMA.extend( @coroutine def to_code(config): - serial = HARDWARE_UART_TO_SERIAL[config[CONF_HARDWARE_UART]] + serial = HARDWARE_UART_TO_SERIAL[PLATFORM_ESP8266][config[CONF_HARDWARE_UART]] var = cg.new_Pvariable(config[CONF_ID], cg.RawExpression(f"&{serial}")) if CONF_BAUD_RATE in config: