Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/converters/fromZigbee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ export const command_move_to_level: Fz.Converter<"genLevelCtrl", undefined, ["co
const payload: KeyValueAny = {
action: postfixWithEndpointName("brightness_move_to_level", msg, model, meta),
action_level: msg.data.level,
action_transition_time: msg.data.transtime / 100,
action_transition_time: msg.data.transtime / 10,
};
addActionGroup(payload, msg, model);

Expand Down Expand Up @@ -1489,7 +1489,7 @@ export const command_step: Fz.Converter<"genLevelCtrl", undefined, ["commandStep
const payload: KeyValueAny = {
action: postfixWithEndpointName(`brightness_step_${direction}`, msg, model, meta),
action_step_size: msg.data.stepsize,
action_transition_time: msg.data.transtime / 100,
action_transition_time: msg.data.transtime / 10,
};
addActionGroup(payload, msg, model);

Expand Down Expand Up @@ -1559,7 +1559,7 @@ export const command_step_color_temperature: Fz.Converter<"lightingColorCtrl", u
};

if (msg.data.transtime !== undefined) {
payload.action_transition_time = msg.data.transtime / 100;
payload.action_transition_time = msg.data.transtime / 10;
}

addActionGroup(payload, msg, model);
Expand Down Expand Up @@ -1608,7 +1608,7 @@ export const command_step_hue: Fz.Converter<"lightingColorCtrl", undefined, ["co
const payload = {
action: postfixWithEndpointName(`color_hue_step_${direction}`, msg, model, meta),
action_step_size: msg.data.stepsize,
action_transition_time: msg.data.transtime / 100,
action_transition_time: msg.data.transtime / 10,
};
addActionGroup(payload, msg, model);
return payload;
Expand All @@ -1623,7 +1623,7 @@ export const command_step_saturation: Fz.Converter<"lightingColorCtrl", undefine
const payload = {
action: postfixWithEndpointName(`color_saturation_step_${direction}`, msg, model, meta),
action_step_size: msg.data.stepsize,
action_transition_time: msg.data.transtime / 100,
action_transition_time: msg.data.transtime / 10,
};
addActionGroup(payload, msg, model);
return payload;
Expand Down Expand Up @@ -1724,7 +1724,7 @@ export const command_move_to_hue: Fz.Converter<"lightingColorCtrl", undefined, "
const payload = {
action: postfixWithEndpointName("move_to_hue", msg, model, meta),
action_hue: msg.data.hue,
action_transition_time: msg.data.transtime / 100,
action_transition_time: msg.data.transtime / 10,
action_direction: msg.data.direction === 0 ? "decrement" : "increment",
};
addActionGroup(payload, msg, model);
Expand Down
4 changes: 2 additions & 2 deletions test/fromZigbee.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ describe("converters/fromZigbee", () => {
expect(payload.action).toBe("color_temperature_step_up");
expect(payload.action_step_size).toBe(5);
expect(payload.action_color_temperature_delta).toBe(5);
expect(payload.action_transition_time).toBe(1);
expect(payload.action_transition_time).toBe(10);
});

it("emits negative action_color_temperature_delta when stepping down", () => {
Expand All @@ -291,7 +291,7 @@ describe("converters/fromZigbee", () => {
expect(payload.action).toBe("color_temperature_step_down");
expect(payload.action_step_size).toBe(10);
expect(payload.action_color_temperature_delta).toBe(-10);
expect(payload.action_transition_time).toBe(0.5);
expect(payload.action_transition_time).toBe(5);
});

it("does not include action_transition_time when transtime is undefined", () => {
Expand Down