From e45955643bf26cc4b350c4e5278151a8f64f313e Mon Sep 17 00:00:00 2001 From: Neppkun <57060018+Neppkun@users.noreply.github.com> Date: Thu, 29 Dec 2022 03:32:17 +0300 Subject: [PATCH] feat(cambion): add state to be consistent (#427) Co-authored-by: Matt <7128721+TobiTenno@users.noreply.github.com> --- lib/CambionCycle.js | 3 ++- test/unit/cambion.spec.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/CambionCycle.js b/lib/CambionCycle.js index 241ae00d4..4af340e94 100644 --- a/lib/CambionCycle.js +++ b/lib/CambionCycle.js @@ -18,7 +18,8 @@ module.exports = class CambionCycle extends WorldstateObject { ({ activation: this.activation, expiry: this.expiry, timeLeft: this.timeLeft } = cetusCycle); - this.active = cetusCycle.isDay ? 'fass' : 'vome'; + this.state = cetusCycle.isDay ? 'fass' : 'vome'; + this.active = this.state; this.id = `cambionCycle${this.expiry.getTime()}`; } diff --git a/test/unit/cambion.spec.js b/test/unit/cambion.spec.js index 9d434aa79..ef731af1d 100644 --- a/test/unit/cambion.spec.js +++ b/test/unit/cambion.spec.js @@ -48,6 +48,7 @@ describe('CambionCycle', function () { ); should.equal(cycle.active, 'fass'); + should.equal(cycle.state, 'fass'); }); it('should show vome for night', () => { @@ -63,6 +64,7 @@ describe('CambionCycle', function () { ); should.equal(cycle.active, 'vome'); + should.equal(cycle.state, 'vome'); }); }); });