mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-10-22 14:01:20 +00:00
Home Assistant: disable expose binary as switch for boolean values. https://github.com/Koenkk/zigbee2mqtt/issues/7797
This commit is contained in:
1 parent
04c4c77d1e
commit
ce311c93b1
1 file changed
+4
-3
@@ -349,8 +349,9 @@ class HomeAssistant extends Extension {
|
||||
* There is also a check on the values for typeof boolean to prevent invalid values and commands
|
||||
* silently failing - commands work fine but some devices won't reject unexpected values.
|
||||
* https://github.com/Koenkk/zigbee2mqtt/issues/7740
|
||||
* Dont expose boolean values for now: https://github.com/Koenkk/zigbee2mqtt/issues/7797
|
||||
*/
|
||||
if (expose.access & ACCESS_SET) {
|
||||
if (expose.access & ACCESS_SET && typeof expose.value_on !== 'boolean') {
|
||||
discoveryEntry = {
|
||||
type: 'switch',
|
||||
object_id: expose.endpoint ?
|
||||
@@ -358,8 +359,8 @@ class HomeAssistant extends Extension {
|
||||
`switch_${expose.name}`,
|
||||
discovery_payload: {
|
||||
value_template: `{{ value_json.${expose.property} }}`,
|
||||
payload_on: typeof expose.value_on == 'boolean' ? 'true' : expose.value_on,
|
||||
payload_off: typeof expose.value_off == 'boolean' ? 'false' : expose.value_off,
|
||||
payload_on: expose.value_on,
|
||||
payload_off: expose.value_off,
|
||||
command_topic: true,
|
||||
command_topic_prefix: expose.endpoint ? expose.endpoint : undefined,
|
||||
command_topic_postfix: expose.property,
|
||||
|
||||
Reference in new issue
Block a user