Merge pull request #153 from ghisch/patch-1

Fix KeyError in ESPHome 2024.6.X
This commit is contained in:
Geoff Davis 2024-06-23 13:52:53 -07:00 committed by GitHub
commit c97f6a097c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,6 +12,7 @@ from esphome.const import (
CONF_MODE,
CONF_FAN_MODE,
CONF_SWING_MODE,
PLATFORM_ESP8266
)
from esphome.core import CORE, coroutine
@ -97,7 +98,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: