Skip to content

Commit

Permalink
fix: Fix Home Assistant truncate error when program is null. #16460
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Jun 12, 2023
1 parent e10dd89 commit 11f0be5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/extension/homeassistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,8 @@ export default class HomeAssistant extends Extension {
const lookup: {[s: string]: KeyValue} = {
action: {icon: 'mdi:gesture-double-tap'},
programming_mode: {icon: 'mdi:calendar-clock'},
program: {value_template: `{{ value_json.${firstExpose.property} | truncate(254, True, '', 0) }}`},
program: {value_template: `{{ value_json.${firstExpose.property}|default("") ` +
`| truncate(254, True, '', 0) }}`},
};

const discoveryEntry: DiscoveryEntry = {
Expand Down

0 comments on commit 11f0be5

Please sign in to comment.