mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-10 14:01:43 +00:00
Attempt to fix Home Assistant error when running_state is unknown. https://github.com/Koenkk/zigbee2mqtt/issues/9219
This commit is contained in:
@@ -216,9 +216,10 @@ export default class HomeAssistant extends Extension {
|
||||
|
||||
const state = firstExpose.features.find((f) => f.name === 'running_state');
|
||||
if (state) {
|
||||
discoveryEntry.mockProperties.push(state.property);
|
||||
discoveryEntry.discovery_payload.action_topic = true;
|
||||
discoveryEntry.discovery_payload.action_template = `{% set values = ` +
|
||||
`{'idle':'off','heat':'heating','cool':'cooling','fan only':'fan'}` +
|
||||
`{None:None,'idle':'off','heat':'heating','cool':'cooling','fan only':'fan'}` +
|
||||
` %}{{ values[value_json.${state.property}] }}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user