Skip to content

Commit

Permalink
Always turn off switch using service instead of update method
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvb14 committed Nov 27, 2024
1 parent 73bc50c commit e001f83
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/devices/protect-camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1293,12 +1293,11 @@ export class ProtectCamera extends ProtectDevice {
// Inform the user, and we're done.
this.log.info("UniFi Protect Camera %s has been change to preset %s successfully.", this.accessoryName, ptzPresetFriendlyName);

// this.accessory.getServiceById(this.hap.Service.Switch, ptzPresetSwitch)?.updateCharacteristic(this.hap.Characteristic.On, false);
setTimeout(() => this.updateDevice(), 50);

return true;
}
});
// Turn off Switch always as we are not stateful
service.updateCharacteristic(this.hap.Characteristic.On, false);
}

return true;
Expand Down

0 comments on commit e001f83

Please sign in to comment.