Skip to content

Commit bb0e118

Browse files
fix: Change action_transition_time unit to seconds (#12675)
1 parent f1531c7 commit bb0e118

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/converters/fromZigbee.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ export const command_move_to_level: Fz.Converter<"genLevelCtrl", undefined, ["co
14271427
const payload: KeyValueAny = {
14281428
action: postfixWithEndpointName("brightness_move_to_level", msg, model, meta),
14291429
action_level: msg.data.level,
1430-
action_transition_time: msg.data.transtime / 100,
1430+
action_transition_time: msg.data.transtime / 10,
14311431
};
14321432
addActionGroup(payload, msg, model);
14331433

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

@@ -1559,7 +1559,7 @@ export const command_step_color_temperature: Fz.Converter<"lightingColorCtrl", u
15591559
};
15601560

15611561
if (msg.data.transtime !== undefined) {
1562-
payload.action_transition_time = msg.data.transtime / 100;
1562+
payload.action_transition_time = msg.data.transtime / 10;
15631563
}
15641564

15651565
addActionGroup(payload, msg, model);
@@ -1608,7 +1608,7 @@ export const command_step_hue: Fz.Converter<"lightingColorCtrl", undefined, ["co
16081608
const payload = {
16091609
action: postfixWithEndpointName(`color_hue_step_${direction}`, msg, model, meta),
16101610
action_step_size: msg.data.stepsize,
1611-
action_transition_time: msg.data.transtime / 100,
1611+
action_transition_time: msg.data.transtime / 10,
16121612
};
16131613
addActionGroup(payload, msg, model);
16141614
return payload;
@@ -1623,7 +1623,7 @@ export const command_step_saturation: Fz.Converter<"lightingColorCtrl", undefine
16231623
const payload = {
16241624
action: postfixWithEndpointName(`color_saturation_step_${direction}`, msg, model, meta),
16251625
action_step_size: msg.data.stepsize,
1626-
action_transition_time: msg.data.transtime / 100,
1626+
action_transition_time: msg.data.transtime / 10,
16271627
};
16281628
addActionGroup(payload, msg, model);
16291629
return payload;
@@ -1724,7 +1724,7 @@ export const command_move_to_hue: Fz.Converter<"lightingColorCtrl", undefined, "
17241724
const payload = {
17251725
action: postfixWithEndpointName("move_to_hue", msg, model, meta),
17261726
action_hue: msg.data.hue,
1727-
action_transition_time: msg.data.transtime / 100,
1727+
action_transition_time: msg.data.transtime / 10,
17281728
action_direction: msg.data.direction === 0 ? "decrement" : "increment",
17291729
};
17301730
addActionGroup(payload, msg, model);

test/fromZigbee.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ describe("converters/fromZigbee", () => {
276276
expect(payload.action).toBe("color_temperature_step_up");
277277
expect(payload.action_step_size).toBe(5);
278278
expect(payload.action_color_temperature_delta).toBe(5);
279-
expect(payload.action_transition_time).toBe(1);
279+
expect(payload.action_transition_time).toBe(10);
280280
});
281281

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

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

0 commit comments

Comments
 (0)