Skip to content

Commit

Permalink
fix(dingz): motion event handling
Browse files Browse the repository at this point in the history
- set value instead of update in additional places
  • Loading branch information
johannrichard committed Dec 8, 2020
1 parent abd34a0 commit bee80d9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/dingzAccessory.ts
Expand Up @@ -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,
);
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit bee80d9

Please sign in to comment.