Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit battery_low for models that don't have it #7677

Merged
merged 1 commit into from
Jun 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ const definitions: Definition[] = [
tuya.whitelabel('QA', 'QASD1', 'Door sensor', ['_TZ3000_udyjylt7']),
],
exposes: (device, options) => {
const exps: Expose[] = [e.contact(), e.battery_low(), e.battery(), e.battery_voltage()];
const exps: Expose[] = [e.contact(), e.battery(), e.battery_voltage()];
const noTamperModels = [ // manufacturerName for models without a tamper sensor
'_TZ3000_2mbfxlzr', // Tuya MC500A
'_TZ3000_n2egfsli', // Tuya 19DZT
Expand All @@ -846,6 +846,14 @@ const definitions: Definition[] = [
if (!device || !noTamperModels.includes(device.manufacturerName)) {
exps.push(e.tamper());
}
const noBatteryLowModels = [
'_TZ3000_26fmupbb',
'_TZ3000_oxslv1c9',
'_TZ3000_osu834un',
];
if (!device || !noBatteryLowModels.includes(device.manufacturerName)) {
exps.push(e.battery_low());
}
exps.push(e.linkquality());
return exps;
},
Expand Down
Loading