From cbd237b95f16154bf7c176d767570ee3c2407545 Mon Sep 17 00:00:00 2001 From: Ilya Antipenko Date: Fri, 5 Jun 2020 17:21:51 +0300 Subject: [PATCH 1/2] Add currentTemperature to README --- README.hbs | 1 + README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.hbs b/README.hbs index a5adab6..6e84073 100644 --- a/README.hbs +++ b/README.hbs @@ -55,6 +55,7 @@ client.on('no_response', () => { | Command | Values | Description | |-|-|-| | **temperature** | any integer |In degrees Celsius by default | +| **currentTemperature** | any integer |In degrees Celsius by default. (Read-only) | | **mode** | _auto_, _cool_, _heat_, _dry_, _fan_only_|Operation mode | | **fanspeed** | _auto_, _low_, _mediumLow_, _medium_, _mediumHigh_, _high_ | Fan speed | | **swinghor** | _default_, _full_, _fixedLeft_, _fixedMidLeft_, _fixedMid_, _fixedMidRight_, _fixedRight_ | Horizontal Swing | diff --git a/README.md b/README.md index 171d0af..06fc80b 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ client.on('no_response', () => { | Command | Values | Description | |-|-|-| | **temperature** | any integer |In degrees Celsius by default | +| **currentTemperature** | any integer |In degrees Celsius by default. (Read-only) | | **mode** | _auto_, _cool_, _heat_, _dry_, _fan_only_|Operation mode | | **fanspeed** | _auto_, _low_, _mediumLow_, _medium_, _mediumHigh_, _high_ | Fan speed | | **swinghor** | _default_, _full_, _fixedLeft_, _fixedMidLeft_, _fixedMid_, _fixedMidRight_, _fixedRight_ | Horizontal Swing | From a03f009bdcfae5d024e4d3d943c7d2c1b1d94385 Mon Sep 17 00:00:00 2001 From: Ilya Antipenko Date: Fri, 5 Jun 2020 17:28:04 +0300 Subject: [PATCH 2/2] Cover TemSen=0 by unit test --- test/property-transformer-test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/property-transformer-test.js b/test/property-transformer-test.js index 71eeddb..8199c9d 100644 --- a/test/property-transformer-test.js +++ b/test/property-transformer-test.js @@ -17,6 +17,17 @@ describe('PropertyTransformer', function () { currentTemperature: 27 }); }); + + it('should not subtract 40 from vendor value in case of zero', function () { + const SUT = new PropertyTransformer(); + const result = SUT.fromVendor({ + TemSen: 0 + }); + + assert.deepEqual(result, { + currentTemperature: 0 + }); + }); }); describe('#toVendor()', function () { it('should transform from human friendly to vendor', function () {