Skip to content

Commit

Permalink
fix: inverted direction for WindowCoveringCCStartLevelChange when s…
Browse files Browse the repository at this point in the history
…ent (#7278)
  • Loading branch information
AlCalzone authored Oct 14, 2024
1 parent 69528d0 commit 00d2574
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/cc/src/cc/WindowCoveringCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -955,8 +955,7 @@ export class WindowCoveringCCStartLevelChange extends WindowCoveringCC {
super(host, options);
if (gotDeserializationOptions(options)) {
validatePayload(this.payload.length >= 2);
const direction = (this.payload[0] & 0b0100_0000) >>> 6;
this.direction = direction ? "down" : "up";
this.direction = !!(this.payload[0] & 0b0100_0000) ? "down" : "up";
this.parameter = this.payload[1];
if (this.payload.length >= 3) {
this.duration = Duration.parseSet(this.payload[2]);
Expand All @@ -974,7 +973,7 @@ export class WindowCoveringCCStartLevelChange extends WindowCoveringCC {

public serialize(): Buffer {
this.payload = Buffer.from([
this.direction === "up" ? 0b0100_0000 : 0b0000_0000,
this.direction === "down" ? 0b0100_0000 : 0b0000_0000,
this.parameter,
(this.duration ?? Duration.default()).serializeSet(),
]);
Expand Down

0 comments on commit 00d2574

Please sign in to comment.