Skip to content

Commit

Permalink
fix: Fix Handling of poll check-in failed for Tuya TS0203 Koenkk/zi…
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Dec 3, 2024
1 parent 8528633 commit 286d454
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/devices/adeo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,10 @@ const definitions: DefinitionWithExtend[] = [
exposes: [e.warning(), e.battery(), e.battery_low(), e.tamper()],
extend: [quirkCheckinInterval(0)],
configure: async (device, coordinatorEndpoint) => {
await device.getEndpoint(1).unbind('genPollCtrl', coordinatorEndpoint);
const endpoint = device.getEndpoint(1);
if (endpoint.binds.some((b) => b.cluster.name === 'genPollCtrl')) {
await endpoint.unbind('genPollCtrl', coordinatorEndpoint);
}
},
},
{
Expand Down
4 changes: 3 additions & 1 deletion src/devices/bosch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,9 @@ const definitions: DefinitionWithExtend[] = [
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'ssIasZone', 'ssIasWd', 'genBasic']);
await reporting.batteryVoltage(endpoint);
await endpoint.read(0x0502, [0xa000, 0xa001, 0xa002, 0xa003, 0xa004, 0xa005], manufacturerOptions);
await endpoint.unbind('genPollCtrl', coordinatorEndpoint);
if (endpoint.binds.some((b) => b.cluster.name === 'genPollCtrl')) {
await endpoint.unbind('genPollCtrl', coordinatorEndpoint);
}
},
exposes: [
e.binary('alarm_state', ea.ALL, 'ON', 'OFF').withDescription('Alarm turn ON/OFF'),
Expand Down
5 changes: 5 additions & 0 deletions src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,11 @@ const definitions: DefinitionWithExtend[] = [
} catch {
/* Fails for some*/
}

const endpoint = device.getEndpoint(1);
if (endpoint.binds.some((b) => b.cluster.name === 'genPollCtrl')) {
await endpoint.unbind('genPollCtrl', coordinatorEndpoint);
}
},
},
{
Expand Down

0 comments on commit 286d454

Please sign in to comment.