From 68b8f2f0841f52d54f4cdb5c8931164f10aca35e Mon Sep 17 00:00:00 2001 From: Jason <37859597+zachowj@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:53:36 -0800 Subject: [PATCH] fix(select): Fix validation of option Fixes #1145 --- src/nodes/select/SelectController.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/nodes/select/SelectController.ts b/src/nodes/select/SelectController.ts index 4465c4b3cf..9bd2c223b0 100644 --- a/src/nodes/select/SelectController.ts +++ b/src/nodes/select/SelectController.ts @@ -123,9 +123,12 @@ export default class SelectController extends InputOutputController< } #isValidValue(option: string): boolean { - const options = this.integration?.getEntityHomeAssistantConfigValue( - 'options' - ) as string; + const options = + this.integration?.getEntityHomeAssistantConfigValue('options'); + + if (!options || !Array.isArray(options)) { + return false; + } return options.includes(option); }