Skip to content

Commit

Permalink
fix(dingz): better blinds error handling
Browse files Browse the repository at this point in the history
- Check the blind status before accessing the value
  • Loading branch information
johannrichard committed Nov 22, 2020
1 parent b3ae78f commit 46b85b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dingzAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ export class DingzDaAccessory extends EventEmitter {
JSON.stringify(this.dingzStates.WindowCovers),
);
let positionState = 0;
const moving = this.dingzStates.WindowCovers[id].moving;
const moving = this.dingzStates.WindowCovers[id]?.moving;
if (moving) {
switch (moving) {
case 'down':
Expand Down

0 comments on commit 46b85b1

Please sign in to comment.