Skip to content

Commit

Permalink
Merge pull request #12 from aivus/update_readme_current_temp
Browse files Browse the repository at this point in the history
Cover TemSen=0 by unit test and update readme files
  • Loading branch information
inwaar authored Jun 12, 2020
2 parents eaa6ea1 + a03f009 commit 4e8a3a7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
11 changes: 11 additions & 0 deletions test/property-transformer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 4e8a3a7

Please sign in to comment.