From a982acc1ca48c49c60b63daf74d33c92dfbb45ff Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 6 Oct 2020 21:42:05 +0200 Subject: [PATCH] Fix tests after https://github.com/Koenkk/zigbee2mqtt/pull/4510 --- lib/extension/homeassistant.js | 2 +- test/homeassistant.test.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/extension/homeassistant.js b/lib/extension/homeassistant.js index a21f8156..83fdddec 100644 --- a/lib/extension/homeassistant.js +++ b/lib/extension/homeassistant.js @@ -827,7 +827,7 @@ const climate = (minTemp=7, maxTemp=30, temperatureStateProperty='occupied_heati retVal.discovery_payload.away_mode_command_topic = true; retVal.discovery_payload.away_mode_state_topic = true; retVal.discovery_payload.away_mode_state_template = - '{{ value_json.away_mode }}'; + `{{ ${jsonProperty('away_mode')} }}`; } if (holdModes.length > 0) { // || indexOfAway > -1) { diff --git a/test/homeassistant.test.js b/test/homeassistant.test.js index d0125762..4ae16bc4 100644 --- a/test/homeassistant.test.js +++ b/test/homeassistant.test.js @@ -437,6 +437,9 @@ describe('HomeAssistant extension', () => { "action_template":"{% set values = {'idle':'off','heat':'heating','cool':'cooling','fan only':'fan'} %}{{ values[value_json.running_state] }}", "action_topic":"zigbee2mqtt/TS0601_thermostat", "availability_topic":"zigbee2mqtt/bridge/state", + "away_mode_command_topic":"zigbee2mqtt/TS0601_thermostat/set/away_mode", + "away_mode_state_template":"{{ value_json.away_mode }}", + "away_mode_state_topic":"zigbee2mqtt/TS0601_thermostat", "current_temperature_template":"{{ value_json.local_temperature }}", "current_temperature_topic":"zigbee2mqtt/TS0601_thermostat", "device":{ @@ -452,7 +455,6 @@ describe('HomeAssistant extension', () => { "hold_modes":[ "schedule", "manual", - "away", "boost", "complex", "comfort",