mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-16 18:39:09 -07:00
Allow binary exposes not in lookup.
This commit is contained in:
parent
fee631080e
commit
922f828696
@ -1165,9 +1165,6 @@ class HomeAssistant extends Extension {
|
||||
const lookup = {
|
||||
occupancy: {device_class: 'motion'},
|
||||
battery_low: {device_class: 'battery'},
|
||||
tamper: {},
|
||||
moving: {},
|
||||
sos: {},
|
||||
water_leak: {device_class: 'moisture'},
|
||||
vibration: {device_class: 'vibration'},
|
||||
contact: {device_class: 'door'},
|
||||
@ -1177,7 +1174,6 @@ class HomeAssistant extends Extension {
|
||||
};
|
||||
|
||||
assert(!expose.endpoint, `Endpoint not supported for binary type`);
|
||||
assert(lookup[expose.name], `${expose.name} not in lookup`);
|
||||
|
||||
discoveryEntry = {
|
||||
type: 'binary_sensor',
|
||||
@ -1186,7 +1182,7 @@ class HomeAssistant extends Extension {
|
||||
value_template: `{{ value_json.${expose.property} }}`,
|
||||
payload_on: expose.value_on,
|
||||
payload_off: expose.value_off,
|
||||
...lookup[expose.name],
|
||||
...(lookup[expose.name] || {}),
|
||||
},
|
||||
};
|
||||
} else if (expose.type === 'numeric') {
|
||||
|
Loading…
Reference in New Issue
Block a user