Skip to content

Commit

Permalink
fix: Fix Home Assistant `Payload is not supported (e.g. open, closed,…
Browse files Browse the repository at this point in the history
… opening, closing, stopped): STOP` error. #17552
  • Loading branch information
Koenkk committed May 26, 2023
1 parent bad365b commit e6f9aed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/extension/homeassistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ export default class HomeAssistant extends Extension {
`{{ value_json.${featurePropertyWithoutEndpoint(state)} }}`,
discoveryEntry.discovery_payload.state_open = 'OPEN';
discoveryEntry.discovery_payload.state_closed = 'CLOSE';
discoveryEntry.discovery_payload.state_stopped = 'STOP';
}

if (!position && !tilt) {
Expand Down
2 changes: 2 additions & 0 deletions test/homeassistant.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ describe('HomeAssistant extension', () => {
value_template: `{{ value_json.state }}`,
state_open: 'OPEN',
state_closed: 'CLOSE',
state_stopped: 'STOP',
json_attributes_topic: 'zigbee2mqtt/smart vent',
name: 'smart vent',
unique_id: '0x0017880104e45551_cover_zigbee2mqtt',
Expand Down Expand Up @@ -866,6 +867,7 @@ describe('HomeAssistant extension', () => {
"position_topic": "zigbee2mqtt/zigfred_plus/l6",
"set_position_template": "{ \"position_l6\": {{ position }} }",
"set_position_topic": "zigbee2mqtt/zigfred_plus/l6/set",
"state_stopped": 'STOP',
"state_closed": "CLOSE",
"state_open": "OPEN",
"state_topic": "zigbee2mqtt/zigfred_plus/l6",
Expand Down

0 comments on commit e6f9aed

Please sign in to comment.