From bee80d9179c190b16bed8d8b5571e0230bf1b10c Mon Sep 17 00:00:00 2001 From: Johann Richard <189003+johannrichard@users.noreply.github.com> Date: Tue, 8 Dec 2020 13:45:24 +0100 Subject: [PATCH] fix(dingz): motion event handling - set value instead of update in additional places --- src/dingzAccessory.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dingzAccessory.ts b/src/dingzAccessory.ts index a859dd7..fb7540f 100644 --- a/src/dingzAccessory.ts +++ b/src/dingzAccessory.ts @@ -480,7 +480,7 @@ export class DingzAccessory extends DingzDaBaseAccessory { this.log.debug('Motion Update from CALLBACK'); this.motionService ?.getCharacteristic(this.platform.Characteristic.MotionDetected) - .updateValue( + .setValue( action === ButtonAction.PIR_MOTION_START ? true : false, ); } @@ -541,10 +541,14 @@ export class DingzAccessory extends DingzDaBaseAccessory { ) ?? this.accessory.addService( this.platform.Service.StatelessProgrammableSwitch, - name ?? `dingz Button ${button}`, // Name Dimmers according to WebUI, not API info + name ?? `Button ${button}`, // Name Dimmers according to WebUI, not API info button, ); + buttonService.setCharacteristic( + this.platform.Characteristic.Name, + name ?? `Button ${button}`, + ); buttonService.setCharacteristic( this.platform.Characteristic.ServiceLabelIndex, button,