Closed uswong closed 2 years ago
For debug, you might have been able to trigger of the debug flag in Cmd4 instead of creating another. Just a thought. This works as well.
John
On Wed, May 11, 2022 at 9:59 AM uswong @.***> wrote:
name: Ability to activate/deactivate diagnostic log ++ about: Resolve an issue and add an improvement to homebridge-cmd4-AdvantageAir. title: "[Pull Request] Ability to activate/deactivate diagnostic log ++" labels: pull-request assignees: mitch7391
In order to minimize "write" events to the temporary directory, the diagnostic logging is deactivated by default. However, it can be re-activated, if required, via a suffix "-debug" to the IP address in the config file. Moreover, the fresh getSystemData is checked and only write to disk if it is different from the cached myAirData.txt.
Some Linux distros do not have "/tmp" as temporary directory but has $TMPDIR defined and is pointing to a different directory. In this version we will use $TMPDIR as the default temporary directory if defined, otherwise we will use "/tmp".
Is your pull request related to a problem or a new feature? Please describe:
1.
Enhancement/new feature: To minimize "write" events to the disk. 2.
Issue: AdvAir.sh fails with writing to "/tmp" denied in some Linux distros.
Describe the solution you'd have implemented:
1.
To minimize write events to the disk by (1) deactivating the diagnostic logging by default but can be activated, if required, by adding a suffix -debug to the IP address in the config file. (2) checking the fresh getSystemData and only write to the disk if it is different from the cached myAirData.txt. 2.
To resolve the writing to "/tmp" denied issue: The issue was due to the absent of "/tmp" in some Linux distros but have $TMPDIR defined pointing to a different directory. The possible solution is to use $TMPDIR as temporary directory if defined, otherwise use "/tmp".
Do your changes pass local testing:
- Yes, passed shellcheck, all unit tests and has been running flawlessly for couple of days on my E-zone system and JohnW's MyPlace system.
- No
Additional context:
To active the diagnostic logging, add a suffix `-debug' to the IP address in the config file as shown below:
[image: image] https://user-images.githubusercontent.com/96530237/167862733-44ab38b5-fc09-44af-a4c1-21b2bdecf8d2.png
You can view, comment on, or merge this pull request online at:
https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60 Commit Summary
- 05aaa35 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/05aaa35b871189fae093fc21e1ae86e65a4f9159 for test on lights
- 1273d93 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/1273d93aa41419850e486b32896a745e3fe126af test: add setLight, setTemp and fan + bug fix
- f023134 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/f0231349a7870d05e762be432144b3ff291645ce test: added sub-directory structure
- df63561 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/df63561c94a30cfa0a52d2d29297e4b537479fe8 test: added sub-directory structure
- 22a2894 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/22a2894d798c8f852308aadfe8cf02996a978bba test: added sub-directory structure
- 1bdf4f3 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/1bdf4f3e546508762cef56da8517507614a3a963 test: added sub-directory + test for lights
- 9d08504 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/9d08504edc04b96c5cb7a2a4fae0f3b9b2dc7dcf test: added sub-directory structure
- 876ae90 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/876ae90b08a6134ab3b82d6070837b53be23c79b test: added sub-directory structure
- e5d96fd https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/e5d96fdf7cf370b96b33c8cb94fe7a78193fecda test: added sub-directory structure
- 890a52e https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/890a52e2bd6e09133b29373a49537bb36488c3c9 test: added sub-directory + test for lights
- d234a80 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/d234a8004139bd37dccd282d686dcf57186debcc test: added sub-directory structure
- 884f487 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/884f4876ea6b42c5913b967f790b025dc1c3e9f4 test: added sub-directory structure
- 0f0e627 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/0f0e62727d22e35a58646e59de8aca6f973634d8 test: added sub-directory structure
- 18ec39f https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/18ec39f814acef6b6e025e7964195f9c817182c3 test: added sub-directory structure
- 3bc569a https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/3bc569af834e5d46c8d7beab15d18831905268e1 test: added sub-directory structure
- 3ed9d30 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/3ed9d30fa9052d5459197d570e69e948818c044c test: added sub-directory structure
- 8f36020 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/8f360202781d67835730ae8af6f49fa737d941d3 test: added sub-directory structure
- 7bdb67e https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/7bdb67efc5c1067101c8b1a9bf9a14f5165fe097 test: added sub-directory + test on lights, etc
- afc626b https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/afc626b463a0ba203904a86b663eef4ae0a10c0f test: added sub-directory + test on lights, etc
- c3e7fda https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/c3e7fdad87d4d37c39e83c81f61ad86de2f5e4d7 test: added sub-directory structure, etc
- 85dca04 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/85dca04e6fffa43aacf530bc0d283c0cbacbe94a test: added sub-directory structure
- aecb563 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/aecb563e0384dcbb5621532241cbd7de3974de63 test: NEW test on set target temperature
- 0a52a14 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/0a52a145a261d11d03ee3d60081787894edbf69f test: added sub-directory structure
- 723e87b https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/723e87bac653562afb80398549da6c87b0cb280e test: added sub-directory structure
- 0455ea0 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/0455ea002c9f3cb30a7c764c9522f0efc268de36 test: added sub-directory structure
- 3b313ad https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/3b313ad180ebafb54970b128a09dfebe6161561d test: added sub-directory structure
- 2d93714 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/2d93714613f7afe9cd168970ca0234f63a57f5df Performance enhancements for large AirCon systems
- 99ec0e8 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/99ec0e8d0119ec6ce86ee84175af07b9be2c1922 test: NEW test for large AirCon systems
- 08b6bc1 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/08b6bc10c18608176f99343528786fc34a4b87e8 Update BigAirConSystem.bats
- 2701bdb https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/2701bdb21bd43b54d626204dfb1cc17d05982719 Merge branch 'mitch7391:beta' into beta
- 9672aab https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/9672aabad04e20c30924c2020c4fd2966ceea4ba bug fix - some "Set" does not write to server
- babda0f https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/babda0fda3b031e1b0bb2244764dc099361fd994 bug fix - double quotes removed for numbers
- 730ca53 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/730ca5384b1299428ff5929f9b3a097e104b9056 bug fix - turn off countDownToOn when aircon is on
- 28c001f https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/28c001ffbf6e13e0f563f6c720c08f505ec57fa4 Merge branch 'mitch7391:beta' into beta
- 074d496 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/074d496c2839f6016b218cb07b171544ed680dac Ability to activate/deactivate diagnostic log ++
- 7845e14 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/7845e147f5e96b1648e964a257c5b2d27a0cf2d6 Use $TMPDIR as temporary directory if defined
- 30d1204 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/30d12049bd2874a69590dd069cb140464bb61a72 Use $TMPDIR as temporary directory if defined
- 17ad6e5 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/17ad6e50b2c6e7bea1ebe429a22dfdf663ff8448 Use $TMPDIR as temporary directory if defined
- 9b2e207 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/9b2e207abaf30414f5079be738ec645d215b2b64 Use $TMPDIR as temporary directory if defined
- d9346d7 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/d9346d76f95fdd2468391c82c1924f32ee92cb70 Use $TMPDIR as temporary directory if defined
- a3dade0 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/a3dade008a99b13d492f0dfd18657214e5f796b6 Use $TMPDIR as temporary directory if defined
- 94f6560 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/94f6560a941eb30c43e415e81a551f13d84ac7c4 Use $TMPDIR as temporary directory if defined
- f0c9368 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/f0c93689bda32082cc6d8e931530e68f4de5b892 Use $TMPDIR as temporary directory if defined
- a305fa3 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/a305fa3a115143418fa57a32272cf411f837eed7 Use $TMPDIR as temporary directory if defined
- 3a3878e https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/3a3878ee76adc5de11301a2d67bfd58eec418c1d Use $TMPDIR as temporary directory if defined
- 32479e8 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/32479e8cd05be571c5b772a3545c861309a84627 Use $TMPDIR as temporary directory if defined
- 7c72926 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/7c72926ed9674f468351e47497a0d0eadccce92f Use $TMPDIR as temporary directory if defined
- 6e17933 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/6e1793349d35252890e3719db73f2d63dfaf1bf7 Use $TMPDIR as temporary directory if defined
- eacec08 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/eacec08ddbc8a6fdd1b5b915b023ba7c20ee65bb Use $TMPDIR as temporary directory if defined
- 0a5dcad https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/0a5dcaddf8a20f384187136bdbe23bff36e038bb Use $TMPDIR as temporary directory if defined
- 8137c48 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/8137c48b5246d6aac08bf1413d500289d25130cd Use $TMPDIR as temporary directory if defined
- 7462588 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/746258869a50c1a894aa776d38a436a60e77946d Add IP-debug test & use $TMPDIR
- 2b72e0b https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/2b72e0b785783e6d008925ef9bed705360df4c16 Use $TMPDIR as temporary directory if defined
- a0c6831 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/a0c6831c2d3783ac33c858404b8a1b802afef0f1 Use $TMPDIR as temporary directory if defined
- 979ee90 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/979ee9047db6108303e3bb797200bd9f251d347d Use $TMPDIR as temporary directory if defined
- 8a7d417 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/8a7d4171a8010dbd86bdc5831f162db2c53b5943 Use $TMPDIR as temporary directory if defined
- da8c0ba https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/da8c0ba7286767b50700674156e85ae5bcd60fa9 Use $TMPDIR as temporary directory if defined
- 69bc6a0 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/69bc6a02ea536e089fb9806807edd5943dfeb87f Use $TMPDIR as temporary directory if defined
- 629bca3 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/629bca3a82857aba8940bbc3db5d3f056faa6a0e Use $TMPDIR as temporary directory if defined
- 1b85d87 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/1b85d87af907f38710a8840fcaefde02166014c6 Use $TMPDIR as temporary directory if defined
- 93d67bb https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/93d67bb320175acf11453b867084909f55b99ec6 Use $TMPDIR as temporary directory if defined
- 182c241 https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/182c241056129ac6b8daad1d509b3f8261008f26 This file been replaced with a new version
- d4731ef https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/commits/d4731ef2411ea84a6a063468b677e78656820ab4 Use $TMPDIR as temporary directory if defined
File Changes
(29 files https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files)
- M AdvAir.sh https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-573bdf7722be3241b74222b96704f0eb187adca833d5cadcd49d01b0cc77bd42 (140)
- M test/AirConServer.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-5238dd18ef6366d156c227773996cb735f4a0d46313f62ea5dd047146522b929 (110)
- M test/AirConServer.js https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-0e92e989766875672a5d08fc79457c8bbe47b8d2fff32ff63b422506d9b5598c (27)
- M test/BigAirConSystem.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-5951d1358013381338665e12f336c0f4f66ebfc65981322b6544aefa563a8977 (48)
- M test/GetAc2CurrentTemperature.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-cdbcb647d314a603e1b949463d6c10b99e2ccae93f7a002e53e146ca09855272 (32)
- M test/GetAirConConstants.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-f0a17e6362cace02b32eb58201914dd8ad85f70b3d2616f492fc79d87f8fdb9b (36)
- M test/GetBrightness.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-b42ae6cdb3db02021d5a7e208cab3bfd20e93c72d7d73b03a060368883ed8070 (20)
- M test/GetCurrentDoorState.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-a78d78f51eccc9c28897511c71b429f475cf33615ed0b33671ccd6756be2a448 (16)
- M test/GetCurrentHeatingCoolingState.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-dd937a6bcc9586c46aad68759c8979ba5248106518ad20e9ad9116c30026cd1d (12)
- M test/GetCurrentTemperature.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-7348015312ca990ef8dff9ecdf6a769aa144117d32b77bf6bcad9f4edf261a31 (32)
- D test/GetCurrentTemperature.bats_old https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-86a9b5e4740848457aa9f94eda41ab649833c2c1a15be3fce7e0fab7eefc0f9a (210)
- M test/GetOn.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-21a8dbad2765cec3b67d9988b3a7e1a958667e52cbc9f54eae5e4e985d607921 (20)
- M test/GetRotationSpeed.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-7eed8fc7abee882342d3d805b7854380a712be10d03cdb4a27eeb6528db74438 (12)
- M test/GetSetRetry.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-a04319f31940b43ef6715b7f5a06b926c7cca420d908c1cd555fa461153191b3 (50)
- M test/GetStatusLowBattery.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-e9ddeb9cedc5f3aa91f891ef90288c69596615611a1c61325a0a1d8ea06fabf3 (12)
- M test/GetTargetDoorState.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-efe9200bc0b7777cef20a0d32d05fa48bbf80c659b751973535f30bf030bb4b3 (16)
- M test/GetTargetHeatingCoolingState.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-b42cd01c42f2b3d30a3b6541eac75cdf48a04cca601f95ed61ef6ece24118b4d (12)
- M test/GetTargetTemperature.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-bbfd52203de16b9e959ffc2740a14a2c2ea6494a48d332606b5dfed5e74594fc (12)
- D test/GetTemperatureDisplayUnits.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-19cf55aa9f8ad72b786299ad0a6a032838f8f496e5200fa9ad8a6b8f67421dda (27)
- M test/InvalidOption.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-e63d7804b67711da4c04a9fb959915953956346700c29a4b38bbfa6f16a3ef9c (115)
- M test/SetBrightness.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-4e8d6690cc362adaf2f750c4ef17b1c4d593194a03234a680e4b1a55816c2d91 (20)
- M test/SetOn.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-89ac6ccf8020f5268a4182a35a89cdc1d1922d86e819fbcfcb0606a8eb4dcd57 (25)
- M test/SetTargetDoorState.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-28a24ce648b6a00d29052ae97ea7d23b3b36cfe571df39b32fc64f76deb9cd15 (16)
- M test/SetTargetHeatingCoolingState.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-a39ffbe66ecd88351ef1652d4aa4f4afdc32fcf84c94cce9d43ec83b67655834 (12)
- M test/SetTargetTemperature.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-63180eac9e70f444055162e4e53b7e165436c1a1dc33f2dcefd067c0de795543 (12)
- M test/StartServer https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-6c43d9c961c782557af0bcb252cd447865e0cc6dabf6e3bb7995154290a33349 (15)
- M test/StopServer https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-2bd6b3bf9da4607f3d272bbeca5fcd0ccf0274537caa600e32ea5b8c590cb1eb (12)
- M test/sampleTest.bats https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-d5e83812640954244478024aabc0521f28c03f319d2589acb96b037f2fa38c45 (16)
- M test/setup https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60/files#diff-fd052f662a1e4154ab2c42a081a2e451d873b4102b1d9636c15cbd2f9e7fa0d3 (4)
Patch Links:
- https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60.patch
https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60.diff
— Reply to this email directly, view it on GitHub https://github.com/mitch7391/homebridge-cmd4-AdvantageAir/pull/60, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCXZFAQC7DMWXOC2BZFDVJO4MNANCNFSM5VVBK2MA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
For debug, you might have been able to trigger of the debug flag in Cmd4 instead of creating another. Just a thought. This works as well.
The -debug
suffix to the IP address is for the activation and deactivation of the additional general logging we coded in the AdvAir.sh during the development phase for MyPlace Extras. General users do not need them but thought that it would be good to have the option to activate it just in case if they have any issue and we can check what is going on.
@uswong just catching up on this, looks like I should hold off on the merge at this point..?
Hi Mitch, you can go ahead to merge the PR. The AdvAir.sh passed all unit tests
with flying colors.
The issue is the test on homebridge-ui which passed all tests when run in Mac but have some errors when run in RPi. Apparently node_modules is platform dependant as stated by John in his server.js.
// node_modules is platform dependant. We need to figure this out // in order for testing to work on all platforms
Thanks @uswong and sorry for the hold up on my end!
name: Ability to activate/deactivate diagnostic log ++ about: Resolve an issue and add an improvement to homebridge-cmd4-AdvantageAir. title: "[Pull Request] Ability to activate/deactivate diagnostic log ++" labels: pull-request assignees: mitch7391
In order to minimize "write" events to the temporary directory, the diagnostic logging is deactivated by default. However, it can be re-activated, if required, via a suffix "-debug" to the IP address in the config file. Moreover, the fresh getSystemData is checked and only write to disk if it is different from the cached myAirData.txt.
Some Linux distros do not have "/tmp" as temporary directory but has $TMPDIR defined and is pointing to a different directory. In this version we will use $TMPDIR as the default temporary directory if defined, otherwise we will use "/tmp".
Is your pull request related to a problem or a new feature? Please describe:
Enhancement/new feature: To minimize "write" events to the disk.
Issue: AdvAir.sh fails with writing to "/tmp" denied in some Linux distros.
Describe the solution you'd have implemented:
To minimize write events to the disk by (1) deactivating the diagnostic logging by default but can be activated, if required, by adding a suffix
-debug
to the IP address in the config file. (2) checking the fresh getSystemData and only write to the disk if it is different from the cached myAirData.txt.To resolve the writing to "/tmp" denied issue: The issue was due to the absent of "/tmp" in some Linux distros but have $TMPDIR defined pointing to a different directory. The possible solution is to use $TMPDIR as temporary directory if defined, otherwise use "/tmp".
Do your changes pass local testing:
Additional context:
All enhancements/new features are under the hook changes, no user action is required.
However, if any diagnostic log is desired, activate it by adding a suffix
-debug
to the IP address in the config file as shown below:An additional
Unit Test
was also added to test this-debug
suffix.