From 56225701f9cdb13b052763190031f255fb909274 Mon Sep 17 00:00:00 2001 From: Paul Monigatti Date: Mon, 30 Aug 2021 09:27:38 +1200 Subject: [PATCH] Fix Packages when using MQTT (#2210) --- esphome/config_validation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esphome/config_validation.py b/esphome/config_validation.py index 3aebca81b8..61ef7d2f9f 100644 --- a/esphome/config_validation.py +++ b/esphome/config_validation.py @@ -1457,7 +1457,11 @@ class OnlyWith(Optional): if self._component in CORE.raw_config or ( CONF_PACKAGES in CORE.raw_config and self._component - in {list(x.keys())[0] for x in CORE.raw_config[CONF_PACKAGES].values()} + in [ + k + for package in CORE.raw_config[CONF_PACKAGES].values() + for k in package.keys() + ] ): return self._default return vol.UNDEFINED