From c728d9e2d85879e49f85ee7fb0151a1a3d20fa57 Mon Sep 17 00:00:00 2001 From: atrovato <1839717+atrovato@users.noreply.github.com> Date: Fri, 7 Apr 2023 09:02:11 +0200 Subject: [PATCH] Fix OpenClose trait --- .../traits/googleActions.openClose.trait.js | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/server/services/google-actions/lib/traits/googleActions.openClose.trait.js b/server/services/google-actions/lib/traits/googleActions.openClose.trait.js index 0fd8b9831d..b61f2f7291 100644 --- a/server/services/google-actions/lib/traits/googleActions.openClose.trait.js +++ b/server/services/google-actions/lib/traits/googleActions.openClose.trait.js @@ -42,16 +42,18 @@ const openCloseTrait = { writeValue: (paramValue) => { return paramValue; }, - features: [ - { - category: DEVICE_FEATURE_CATEGORIES.CURTAIN, - type: DEVICE_FEATURE_TYPES.CURTAIN.POSITION, - }, - { - category: DEVICE_FEATURE_CATEGORIES.SHUTTER, - type: DEVICE_FEATURE_TYPES.SHUTTER.POSITION, - }, - ], + getFeatures: () => { + return [ + { + category: DEVICE_FEATURE_CATEGORIES.CURTAIN, + type: DEVICE_FEATURE_TYPES.CURTAIN.POSITION, + }, + { + category: DEVICE_FEATURE_CATEGORIES.SHUTTER, + type: DEVICE_FEATURE_TYPES.SHUTTER.POSITION, + }, + ]; + }, }, }, },