From c130ddbe9cabcfa88ade0d489414aecc82850548 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Wed, 29 May 2024 20:58:13 -0500 Subject: [PATCH] [micro_wake_word] Ensure model string is Path (#6826) --- esphome/components/micro_wake_word/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/esphome/components/micro_wake_word/__init__.py b/esphome/components/micro_wake_word/__init__.py index 9073d103f1..def2808e54 100644 --- a/esphome/components/micro_wake_word/__init__.py +++ b/esphome/components/micro_wake_word/__init__.py @@ -329,11 +329,14 @@ async def to_code(config): file: Path = base_dir / h.hexdigest()[:8] / model_config[CONF_FILE] elif model_config[CONF_TYPE] == TYPE_LOCAL: - file = model_config[CONF_PATH] + file = Path(model_config[CONF_PATH]) elif model_config[CONF_TYPE] == TYPE_HTTP: file = _compute_local_file_path(model_config) / "manifest.json" + else: + raise ValueError("Unsupported config type: {model_config[CONF_TYPE]}") + manifest, data = _load_model_data(file) rhs = [HexInt(x) for x in data]