From f0127511b0ad77bb32fdc6b39c0ffe5fd6efc0fd Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 5 Dec 2022 15:01:18 +0100 Subject: [PATCH] Handle optional state enum from sensor entities (#14428) --- src/common/entity/get_states.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/entity/get_states.ts b/src/common/entity/get_states.ts index 7c59eb2faa..92c1365b14 100644 --- a/src/common/entity/get_states.ts +++ b/src/common/entity/get_states.ts @@ -261,6 +261,11 @@ export const getStates = ( result.push(...state.attributes.activity_list); } break; + case "sensor": + if (!attribute && state.attributes.device_class === "enum") { + result.push(...state.attributes.options); + } + break; case "vacuum": if (attribute === "fan_speed") { result.push(...state.attributes.fan_speed_list);