fix: Fix Home Assistant Invalid state message error when state is too long (#24045)

This commit is contained in:
Koen Kanters
2024-09-21 00:06:44 +02:00
committed by GitHub
parent 951bbd3576
commit 7ad51ce662
+1 -1
View File
@@ -1203,7 +1203,7 @@ export default class HomeAssistant extends Extension {
name: endpoint ? `${firstExposeTyped.label} ${endpoint}` : firstExposeTyped.label,
// Truncate text if it's too long
// https://github.com/Koenkk/zigbee2mqtt/issues/23199
value_template: `{{ value_json.${firstExposeTyped.property}|default('',True) | truncate(254, True, '', 0) }}`,
value_template: `{{ value_json.${firstExposeTyped.property} | default('',True) | string | truncate(254, True, '', 0) }}`,
enabled_by_default: !settableText,
...LIST_DISCOVERY_LOOKUP[firstExposeTyped.name],
},