Skip to content

Commit

Permalink
fix(ignore): Fix "Permit join timeout" template (#20096)
Browse files Browse the repository at this point in the history
  • Loading branch information
mundschenk-at authored Dec 8, 2023
1 parent cb50942 commit 59efc15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/extension/homeassistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1878,8 +1878,8 @@ export default class HomeAssistant extends Extension {
entity_category: 'diagnostic',
state_topic: true,
state_topic_postfix: 'info',
value_template: '{{ int(value_json.permit_join_timeout, default="unknown") }}',
expire_after: 2,
value_template:
'{{ iif(value_json.permit_join_timeout is defined, value_json.permit_join_timeout, None) }}',
},
},

Expand Down
3 changes: 1 addition & 2 deletions test/homeassistant.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2410,8 +2410,7 @@ describe('HomeAssistant extension', () => {
'unit_of_measurement': 's',
'unique_id': 'bridge_0x00124b00120144ae_permit_join_timeout_zigbee2mqtt',
'state_topic': 'zigbee2mqtt/bridge/info',
'value_template': '{{ int(value_json.permit_join_timeout, default="unknown") }}',
'expire_after': 2,
'value_template': '{{ iif(value_json.permit_join_timeout is defined, value_json.permit_join_timeout, None) }}',
'origin': origin,
'device': devicePayload,
'availability': [{'topic': 'zigbee2mqtt/bridge/state'}],
Expand Down

0 comments on commit 59efc15

Please sign in to comment.