sushilks / kumojs

Api Gateway and CLI Controller for Mitsubishi Airconditioners
Apache License 2.0
47 stars 15 forks source link

Fix for Typescript 4 #13

Closed rikbrown closed 4 years ago

rikbrown commented 4 years ago

Description

The current code uses an old version of Typescript - and at least when I tried to build it locally this seemed to conflict with my local environment (even after trying npm install -g typescript@2).

I just fixed the code to work with Typescript 4+ by modifying a few types + splices.

Should resolve https://github.com/sushilks/kumojs/issues/4 too.

Note: Not 100% on the process.cwd() fix - but certainly when I was running locally the previous ./ was looking in the same directory as the script, not the working directory where kumoconfig generated the .cfg.

Testing

Tested with local AC:

curl http://127.0.0.1:8084/v0/room/Bedroom/status
{"r":{"indoorUnit":{"status":{"roomTemp":26,"mode":"heat","spCool":24,"spHeat":21,"vaneDir":"auto","fanSpeed":"auto","tempSource":"unset","activeThermistor":"unset","filterDirty":false,"hotAdjust":false,"defrost":false,"standby":false,"runTest":0}}}}⏎
sushilks commented 4 years ago

thanks