bitfocus / companion-module-homeassistant-server

MIT License
12 stars 7 forks source link

feat: Add value variable #12

Closed royvandongen closed 2 years ago

royvandongen commented 2 years ago

This commit reflects the addition of a .value variable, while leaving the old style variable intact. This is only done for backwards compatibility and any extensions to the variables should be made in new style to prevent conflicts further down the line. According to Home Assistant manuals there are other optional variables which can be used. see https://www.home-assistant.io/docs/configuration/state_object for more information about the available attributes.

kjetilpp commented 2 years ago

Did try to checkout and run this PR, but with no luck.

`root@raspberrypi:/usr/local/src/companion/module-local-dev/companion-module-homeassistant-server# gh pr checkout 12 remote: Enumerating objects: 11, done. remote: Counting objects: 100% (11/11), done. remote: Compressing objects: 100% (8/8), done. remote: Total 8 (delta 6), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (8/8), done. From https://github.com/bitfocus/companion-module-homeassistant-server

21 label: Entity: ${(_a = entity.attributes.friendly_name) !== null && _a !== void 0 ? _a : entity.entity_id}, ~~

src/variables.ts:21:73 - error TS2304: Cannot find name '_a'.

21 label: Entity: ${(_a = entity.attributes.friendly_name) !== null && _a !== void 0 ? _a : entity.entity_id}, ~~

src/variables.ts:21:89 - error TS2304: Cannot find name '_a'.

21 label: Entity: ${(_a = entity.attributes.friendly_name) !== null && _a !== void 0 ? _a : entity.entity_id}, ~~

Found 3 errors.

error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Julusian commented 2 years ago

This is merged and in the 3962 beta build