@mp-consulting/homebridge-daikin-cloud 1.3.6 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/LICENSE +39 -1
  2. package/README.md +3 -1
  3. package/dist/src/accessories/air-conditioning-accessory.d.ts +2 -2
  4. package/dist/src/accessories/air-conditioning-accessory.d.ts.map +1 -1
  5. package/dist/src/accessories/air-conditioning-accessory.js.map +1 -1
  6. package/dist/src/accessories/altherma-accessory.d.ts +2 -2
  7. package/dist/src/accessories/altherma-accessory.d.ts.map +1 -1
  8. package/dist/src/accessories/altherma-accessory.js.map +1 -1
  9. package/dist/src/accessories/base-accessory.d.ts +5 -5
  10. package/dist/src/accessories/base-accessory.d.ts.map +1 -1
  11. package/dist/src/accessories/base-accessory.js +7 -4
  12. package/dist/src/accessories/base-accessory.js.map +1 -1
  13. package/dist/src/api/daikin-api.d.ts +25 -25
  14. package/dist/src/api/daikin-api.d.ts.map +1 -1
  15. package/dist/src/api/daikin-api.js +41 -31
  16. package/dist/src/api/daikin-api.js.map +1 -1
  17. package/dist/src/api/daikin-cloud.repository.d.ts.map +1 -1
  18. package/dist/src/api/daikin-cloud.repository.js.map +1 -1
  19. package/dist/src/api/daikin-controller.d.ts +41 -42
  20. package/dist/src/api/daikin-controller.d.ts.map +1 -1
  21. package/dist/src/api/daikin-controller.js +39 -39
  22. package/dist/src/api/daikin-controller.js.map +1 -1
  23. package/dist/src/api/daikin-device.d.ts +33 -31
  24. package/dist/src/api/daikin-device.d.ts.map +1 -1
  25. package/dist/src/api/daikin-device.js +40 -29
  26. package/dist/src/api/daikin-device.js.map +1 -1
  27. package/dist/src/api/daikin-mobile-oauth.d.ts +16 -16
  28. package/dist/src/api/daikin-mobile-oauth.d.ts.map +1 -1
  29. package/dist/src/api/daikin-mobile-oauth.js +32 -22
  30. package/dist/src/api/daikin-mobile-oauth.js.map +1 -1
  31. package/dist/src/api/daikin-oauth.d.ts +29 -29
  32. package/dist/src/api/daikin-oauth.d.ts.map +1 -1
  33. package/dist/src/api/daikin-oauth.js +45 -35
  34. package/dist/src/api/daikin-oauth.js.map +1 -1
  35. package/dist/src/api/daikin-schemas.d.ts +4 -4
  36. package/dist/src/api/daikin-schemas.js +3 -3
  37. package/dist/src/api/daikin-schemas.js.map +1 -1
  38. package/dist/src/api/daikin-types.js.map +1 -1
  39. package/dist/src/api/daikin-websocket.d.ts +31 -32
  40. package/dist/src/api/daikin-websocket.d.ts.map +1 -1
  41. package/dist/src/api/daikin-websocket.js +30 -30
  42. package/dist/src/api/daikin-websocket.js.map +1 -1
  43. package/dist/src/api/index.d.ts +1 -1
  44. package/dist/src/api/index.d.ts.map +1 -1
  45. package/dist/src/api/index.js +2 -1
  46. package/dist/src/api/index.js.map +1 -1
  47. package/dist/src/api/token-storage.d.ts +1 -1
  48. package/dist/src/api/token-storage.d.ts.map +1 -1
  49. package/dist/src/api/token-storage.js +20 -11
  50. package/dist/src/api/token-storage.js.map +1 -1
  51. package/dist/src/config/config-manager.d.ts +33 -33
  52. package/dist/src/config/config-manager.d.ts.map +1 -1
  53. package/dist/src/config/config-manager.js +33 -33
  54. package/dist/src/config/config-manager.js.map +1 -1
  55. package/dist/src/constants/api.constants.js.map +1 -1
  56. package/dist/src/device/accessory-factory.d.ts +10 -10
  57. package/dist/src/device/accessory-factory.d.ts.map +1 -1
  58. package/dist/src/device/accessory-factory.js +6 -6
  59. package/dist/src/device/accessory-factory.js.map +1 -1
  60. package/dist/src/device/capability-detector.d.ts +8 -8
  61. package/dist/src/device/capability-detector.d.ts.map +1 -1
  62. package/dist/src/device/capability-detector.js +6 -6
  63. package/dist/src/device/capability-detector.js.map +1 -1
  64. package/dist/src/device/capability-docs.d.ts +1 -1
  65. package/dist/src/device/capability-docs.d.ts.map +1 -1
  66. package/dist/src/device/capability-docs.js +1 -2
  67. package/dist/src/device/capability-docs.js.map +1 -1
  68. package/dist/src/device/profiles/device-profile.d.ts +1 -1
  69. package/dist/src/device/profiles/device-profile.d.ts.map +1 -1
  70. package/dist/src/device/profiles/device-profile.js +4 -4
  71. package/dist/src/device/profiles/device-profile.js.map +1 -1
  72. package/dist/src/features/base-feature.d.ts +2 -2
  73. package/dist/src/features/base-feature.d.ts.map +1 -1
  74. package/dist/src/features/base-feature.js +2 -3
  75. package/dist/src/features/base-feature.js.map +1 -1
  76. package/dist/src/features/feature-manager.d.ts +8 -8
  77. package/dist/src/features/feature-manager.d.ts.map +1 -1
  78. package/dist/src/features/feature-manager.js +5 -5
  79. package/dist/src/features/feature-manager.js.map +1 -1
  80. package/dist/src/features/modes/dry-operation-mode.feature.d.ts +1 -1
  81. package/dist/src/features/modes/dry-operation-mode.feature.d.ts.map +1 -1
  82. package/dist/src/features/modes/dry-operation-mode.feature.js.map +1 -1
  83. package/dist/src/features/modes/econo-mode.feature.d.ts +1 -1
  84. package/dist/src/features/modes/econo-mode.feature.d.ts.map +1 -1
  85. package/dist/src/features/modes/econo-mode.feature.js.map +1 -1
  86. package/dist/src/features/modes/fan-only-operation-mode.feature.d.ts +1 -1
  87. package/dist/src/features/modes/fan-only-operation-mode.feature.d.ts.map +1 -1
  88. package/dist/src/features/modes/fan-only-operation-mode.feature.js.map +1 -1
  89. package/dist/src/features/modes/indoor-silent-mode.feature.d.ts +1 -1
  90. package/dist/src/features/modes/indoor-silent-mode.feature.d.ts.map +1 -1
  91. package/dist/src/features/modes/indoor-silent-mode.feature.js.map +1 -1
  92. package/dist/src/features/modes/outdoor-silent-mode.feature.d.ts +1 -1
  93. package/dist/src/features/modes/outdoor-silent-mode.feature.d.ts.map +1 -1
  94. package/dist/src/features/modes/outdoor-silent-mode.feature.js.map +1 -1
  95. package/dist/src/features/modes/powerful-mode.feature.d.ts +1 -1
  96. package/dist/src/features/modes/powerful-mode.feature.d.ts.map +1 -1
  97. package/dist/src/features/modes/powerful-mode.feature.js.map +1 -1
  98. package/dist/src/features/modes/streamer-mode.feature.d.ts +1 -1
  99. package/dist/src/features/modes/streamer-mode.feature.d.ts.map +1 -1
  100. package/dist/src/features/modes/streamer-mode.feature.js.map +1 -1
  101. package/dist/src/index.d.ts +1 -1
  102. package/dist/src/index.d.ts.map +1 -1
  103. package/dist/src/index.js.map +1 -1
  104. package/dist/src/platform.d.ts +6 -5
  105. package/dist/src/platform.d.ts.map +1 -1
  106. package/dist/src/platform.js +2 -2
  107. package/dist/src/platform.js.map +1 -1
  108. package/dist/src/services/climate-control.service.d.ts +8 -2
  109. package/dist/src/services/climate-control.service.d.ts.map +1 -1
  110. package/dist/src/services/climate-control.service.js +53 -59
  111. package/dist/src/services/climate-control.service.js.map +1 -1
  112. package/dist/src/services/hot-water-tank.service.d.ts +6 -2
  113. package/dist/src/services/hot-water-tank.service.d.ts.map +1 -1
  114. package/dist/src/services/hot-water-tank.service.js +31 -34
  115. package/dist/src/services/hot-water-tank.service.js.map +1 -1
  116. package/dist/src/types/daikin-enums.js +12 -12
  117. package/dist/src/types/daikin-enums.js.map +1 -1
  118. package/dist/src/types/device-capabilities.d.ts +1 -1
  119. package/dist/src/types/device-capabilities.d.ts.map +1 -1
  120. package/dist/src/utils/log-context.d.ts +23 -23
  121. package/dist/src/utils/log-context.d.ts.map +1 -1
  122. package/dist/src/utils/log-context.js +28 -28
  123. package/dist/src/utils/log-context.js.map +1 -1
  124. package/dist/src/utils/strings.d.ts.map +1 -1
  125. package/dist/src/utils/strings.js.map +1 -1
  126. package/dist/src/utils/update-mapper.d.ts +16 -16
  127. package/dist/src/utils/update-mapper.d.ts.map +1 -1
  128. package/dist/src/utils/update-mapper.js +14 -14
  129. package/dist/src/utils/update-mapper.js.map +1 -1
  130. package/homebridge-ui/public/script.js +956 -897
  131. package/homebridge-ui/server.js +739 -695
  132. package/package.json +27 -24
  133. package/.claude/settings.json +0 -3
  134. package/.claude/settings.local.json +0 -24
  135. package/CHANGELOG.md +0 -114
  136. package/CLAUDE.md +0 -269
  137. package/config.md +0 -2
  138. package/docs/ARCHITECTURE.md +0 -645
  139. package/docs/IMPLEMENTATION_GUIDE.md +0 -899
  140. package/docs/IMPROVEMENTS_SUMMARY.md +0 -415
  141. package/docs/NEXT_STEPS.md +0 -368
  142. package/docs/Screenshot 2024-07-04 at 18.41.28.png +0 -0
  143. package/docs/TROUBLESHOOTING.md +0 -475
  144. package/docs/api-response-for-BRP069A8x.json +0 -520
  145. package/docs/api-response-for-BRP069C4x-2.json +0 -881
  146. package/docs/api-response-for-BRP069C4x.json +0 -916
  147. package/docs/api-response-for-altherma.json +0 -759
  148. package/docs/api-response-for-altherma2.json +0 -2735
  149. package/docs/api-response-with-multiple-devices-incl-heatpump.json +0 -2544
  150. package/docs/cr-insance-altherma-id-0.json +0 -834
  151. package/docs/mock-air-to-air-dx23.json +0 -759
  152. package/docs/mock-air-to-air-dx4.json +0 -1134
  153. package/docs/mock-airpurifier-with-humidifier.json +0 -732
  154. package/docs/mock-airpurifier.json +0 -450
  155. package/docs/mock-altherma-air-to-water-lan.json +0 -845
  156. package/docs/mock-altherma-air-to-water-wlan.json +0 -845
  157. package/docs/mock-d2cnd-gas-boiler.json +0 -649
  158. package/docs/setpointmode-vs-controlmode-vs-setpoints-vs-sensorydata.txt +0 -6
  159. package/images/fan-speed.jpeg +0 -0
  160. package/images/homekit-controls.jpeg +0 -0
  161. package/images/homekit-settings.jpeg +0 -0
  162. package/images/swing-mode.png +0 -0
  163. package/jest.config.ts +0 -21
  164. package/test/fixtures/altherma-crSense-2.ts +0 -834
  165. package/test/fixtures/altherma-fraction.ts +0 -718
  166. package/test/fixtures/altherma-heat-pump-2.ts +0 -479
  167. package/test/fixtures/altherma-heat-pump.ts +0 -757
  168. package/test/fixtures/altherma-miladcerkic-off.ts +0 -524
  169. package/test/fixtures/altherma-miladcerkic.ts +0 -524
  170. package/test/fixtures/altherma-v1ckoeln.ts +0 -644
  171. package/test/fixtures/altherma-with-embedded-id-zero.ts +0 -834
  172. package/test/fixtures/dx23-airco-2.ts +0 -343
  173. package/test/fixtures/dx23-airco.ts +0 -518
  174. package/test/fixtures/dx4-airco.ts +0 -914
  175. package/test/fixtures/unknown-jan.ts +0 -488
  176. package/test/fixtures/unknown-kitchen-guests.ts +0 -488
  177. package/test/hbConfig/.daikin-mobile-tokenset +0 -8
  178. package/test/hbConfig/.uix-dashboard.json +0 -1
  179. package/test/hbConfig/.uix-secrets +0 -1
  180. package/test/hbConfig/accessories/.cachedAccessories.bak +0 -1
  181. package/test/hbConfig/accessories/cachedAccessories +0 -1
  182. package/test/hbConfig/accessories/uiAccessoriesLayout.json +0 -1
  183. package/test/hbConfig/auth.json +0 -10
  184. package/test/hbConfig/backups/config-backups/config.json.1767953686461 +0 -25
  185. package/test/hbConfig/backups/config-backups/config.json.1767953695236 +0 -29
  186. package/test/hbConfig/backups/config-backups/config.json.1767953814763 +0 -29
  187. package/test/hbConfig/backups/config-backups/config.json.1767953823101 +0 -29
  188. package/test/hbConfig/backups/config-backups/config.json.1767954822835 +0 -29
  189. package/test/hbConfig/backups/config-backups/config.json.1767954859218 +0 -29
  190. package/test/hbConfig/backups/config-backups/config.json.1767960145503 +0 -33
  191. package/test/hbConfig/backups/config-backups/config.json.1767960168068 +0 -44
  192. package/test/hbConfig/backups/config-backups/config.json.1767960170333 +0 -46
  193. package/test/hbConfig/backups/config-backups/config.json.1767960172731 +0 -44
  194. package/test/hbConfig/backups/config-backups/config.json.1767960179323 +0 -44
  195. package/test/hbConfig/backups/config-backups/config.json.1767960182114 +0 -44
  196. package/test/hbConfig/backups/config-backups/config.json.1767960189302 +0 -44
  197. package/test/hbConfig/backups/config-backups/config.json.1767960195194 +0 -44
  198. package/test/hbConfig/backups/config-backups/config.json.1767960197301 +0 -44
  199. package/test/hbConfig/backups/config-backups/config.json.1767960199151 +0 -44
  200. package/test/hbConfig/backups/config-backups/config.json.1767960199667 +0 -44
  201. package/test/hbConfig/backups/config-backups/config.json.1767960329839 +0 -44
  202. package/test/hbConfig/backups/config-backups/config.json.1767960334503 +0 -44
  203. package/test/hbConfig/backups/config-backups/config.json.1767960336208 +0 -44
  204. package/test/hbConfig/backups/config-backups/config.json.1767960338537 +0 -44
  205. package/test/hbConfig/backups/config-backups/config.json.1767963223953 +0 -44
  206. package/test/hbConfig/backups/config-backups/config.json.1767963241753 +0 -44
  207. package/test/hbConfig/backups/config-backups/config.json.1767963252785 +0 -44
  208. package/test/hbConfig/backups/config-backups/config.json.1767963463944 +0 -44
  209. package/test/hbConfig/backups/config-backups/config.json.1767963834475 +0 -44
  210. package/test/hbConfig/backups/config-backups/config.json.1767963838474 +0 -44
  211. package/test/hbConfig/backups/config-backups/config.json.1767963843066 +0 -44
  212. package/test/hbConfig/backups/config-backups/config.json.1767965217715 +0 -44
  213. package/test/hbConfig/backups/config-backups/config.json.1767965419624 +0 -25
  214. package/test/hbConfig/backups/config-backups/config.json.1767965870934 +0 -32
  215. package/test/hbConfig/backups/config-backups/config.json.1767977675045 +0 -32
  216. package/test/hbConfig/backups/config-backups/config.json.1767977677222 +0 -33
  217. package/test/hbConfig/backups/config-backups/config.json.1767977710226 +0 -33
  218. package/test/hbConfig/backups/config-backups/config.json.1767977741397 +0 -33
  219. package/test/hbConfig/backups/config-backups/config.json.1767977977093 +0 -35
  220. package/test/hbConfig/backups/config-backups/config.json.1767977981773 +0 -35
  221. package/test/hbConfig/backups/config-backups/config.json.1767977986514 +0 -35
  222. package/test/hbConfig/backups/config-backups/config.json.1767977991174 +0 -35
  223. package/test/hbConfig/backups/config-backups/config.json.1767979424487 +0 -35
  224. package/test/hbConfig/backups/config-backups/config.json.1767979424987 +0 -35
  225. package/test/hbConfig/backups/config-backups/config.json.1767979432646 +0 -47
  226. package/test/hbConfig/backups/config-backups/config.json.1767979433150 +0 -47
  227. package/test/hbConfig/backups/config-backups/config.json.1767979436933 +0 -47
  228. package/test/hbConfig/backups/config-backups/config.json.1767979437438 +0 -47
  229. package/test/hbConfig/backups/config-backups/config.json.1767979441676 +0 -47
  230. package/test/hbConfig/backups/config-backups/config.json.1767979442180 +0 -47
  231. package/test/hbConfig/backups/config-backups/config.json.1767979466735 +0 -47
  232. package/test/hbConfig/backups/config-backups/config.json.1767979903636 +0 -47
  233. package/test/hbConfig/backups/config-backups/config.json.1767979904135 +0 -47
  234. package/test/hbConfig/backups/config-backups/config.json.1767979906606 +0 -47
  235. package/test/hbConfig/backups/config-backups/config.json.1767979907108 +0 -47
  236. package/test/hbConfig/backups/config-backups/config.json.1767988702341 +0 -47
  237. package/test/hbConfig/backups/config-backups/config.json.1767988702837 +0 -47
  238. package/test/hbConfig/backups/config-backups/config.json.1767988713159 +0 -47
  239. package/test/hbConfig/backups/config-backups/config.json.1767988713664 +0 -47
  240. package/test/hbConfig/backups/config-backups/config.json.1767988918139 +0 -47
  241. package/test/hbConfig/backups/config-backups/config.json.1767988918639 +0 -47
  242. package/test/hbConfig/backups/config-backups/config.json.1767988921120 +0 -47
  243. package/test/hbConfig/backups/config-backups/config.json.1767988921624 +0 -47
  244. package/test/hbConfig/backups/config-backups/config.json.1767988930307 +0 -47
  245. package/test/hbConfig/backups/config-backups/config.json.1767988935070 +0 -47
  246. package/test/hbConfig/backups/config-backups/config.json.1767988935574 +0 -47
  247. package/test/hbConfig/backups/config-backups/config.json.1767989710262 +0 -47
  248. package/test/hbConfig/backups/config-backups/config.json.1767989710760 +0 -47
  249. package/test/hbConfig/backups/config-backups/config.json.1767989729668 +0 -47
  250. package/test/hbConfig/backups/config-backups/config.json.1767990295225 +0 -47
  251. package/test/hbConfig/backups/config-backups/config.json.1767990479921 +0 -47
  252. package/test/hbConfig/backups/config-backups/config.json.1767990481702 +0 -49
  253. package/test/hbConfig/backups/instance-backups/homebridge-backup-1E4A432551BA.1768010187391.tar.gz +0 -0
  254. package/test/hbConfig/backups/instance-backups/homebridge-backup-1E4A432551BA.1768096587387.tar.gz +0 -0
  255. package/test/hbConfig/backups/instance-backups/homebridge-backup-1E4A432551BA.1768182987404.tar.gz +0 -0
  256. package/test/hbConfig/config.json +0 -47
  257. package/test/hbConfig/daikin-cloud-certs/server.crt +0 -22
  258. package/test/hbConfig/daikin-cloud-certs/server.key +0 -28
  259. package/test/hbConfig/persist/AccessoryInfo.1E4A432551BA.json +0 -1
  260. package/test/hbConfig/persist/IdentifierCache.1E4A432551BA.json +0 -1
  261. package/test/hbConfig/tmp/daikin_request/api.onecta.daikineurope.com_01-09-2026-23-29-52/request_14758 +0 -1
  262. package/test/hbConfig/tmp/daikin_request/api.onecta.daikineurope.com_01-09-2026-23-29-52/request_14759 +0 -1
  263. package/test/hbConfig/tmp/daikin_request/api.onecta.daikineurope.com_01-09-2026-23-29-52/request_14760 +0 -1
  264. package/test/hbConfig/tmp/daikin_request/api.onecta.daikineurope.com_01-09-2026-23-29-52/request_14761 +0 -1
  265. package/test/hbConfig/tmp/daikin_request/api.onecta.daikineurope.com_01-09-2026-23-29-52/request_14762 +0 -1
  266. package/test/hbConfig/tmp/daikin_request/api.onecta.daikineurope.com_01-09-2026-23-29-52/request_14764 +0 -1
  267. package/test/helpers/test-isolation.ts +0 -228
  268. package/test/integration/air-conditioning.test.ts +0 -396
  269. package/test/integration/altherma.test.ts +0 -279
  270. package/test/integration/platform.test.ts +0 -118
  271. package/test/mobile-tokens.json +0 -8
  272. package/test/mocks/index.ts +0 -27
  273. package/test/test-gigya-auth.js +0 -443
  274. package/test/test-mobile-oauth.js +0 -175
  275. package/test/test-websocket-mobile.js +0 -123
  276. package/test/test-websocket.js +0 -116
  277. package/test/unit/api/__snapshots__/daikinCloud.test.ts.snap +0 -1320
  278. package/test/unit/api/daikin-api.test.ts +0 -442
  279. package/test/unit/api/daikin-cloud-repository.test.ts +0 -107
  280. package/test/unit/api/daikin-oauth.test.ts +0 -214
  281. package/test/unit/api/daikinCloud.test.ts +0 -12
  282. package/test/unit/api/token-storage.test.ts +0 -90
  283. package/test/unit/config/config-manager.test.ts +0 -271
  284. package/test/unit/device/daikin-device.test.ts +0 -73
  285. package/test/unit/services/hot-water-tank.service.test.ts +0 -123
  286. package/test/unit/utils/log-context.test.ts +0 -271
  287. package/test/unit/utils/update-mapper.test.ts +0 -404
@@ -1,368 +0,0 @@
1
- # Next Steps for Completing Improvements
2
-
3
- ## Overview
4
-
5
- Phase 1 improvements are **100% complete** and committed. The remaining improvements (Phases 2-3) require approximately **27-39 hours** of development time. This document provides a quick-start guide for continuing the work.
6
-
7
- ## What's Already Done ✅
8
-
9
- ### Foundation (Phase 1)
10
- - ✅ Strict TypeScript checking enabled
11
- - ✅ Zod validation layer implemented
12
- - ✅ WebSocket logic consolidated (removed 180+ lines of duplication)
13
- - ✅ GitHub Actions updated to v4
14
- - ✅ Comprehensive documentation created:
15
- - [ARCHITECTURE.md](docs/ARCHITECTURE.md) - System design
16
- - [IMPLEMENTATION_GUIDE.md](docs/IMPLEMENTATION_GUIDE.md) - Detailed implementation steps
17
- - [IMPROVEMENTS_SUMMARY.md](docs/IMPROVEMENTS_SUMMARY.md) - Progress tracking
18
-
19
- ### Utilities Created
20
- - ✅ `src/api/daikin-schemas.ts` - Zod validation schemas
21
- - ✅ `src/utils/update-mapper.ts` - Consolidated WebSocket updates
22
- - ✅ `src/utils/retry.ts` - Retry logic with exponential backoff
23
- - ✅ `src/api/daikin-device-tracker.ts` - Device state tracking and error history
24
-
25
- ## What's Remaining (6 Tasks)
26
-
27
- ### Quick Reference Table
28
-
29
- | Task | Priority | Effort | Complexity | Documentation |
30
- |------|----------|--------|------------|---------------|
31
- | OAuth Integration Tests | High | 4-6h | Medium | [IMPLEMENTATION_GUIDE.md#16-add-integration-tests-for-oauth-flows](IMPLEMENTATION_GUIDE.md#16-add-integration-tests-for-oauth-flows) |
32
- | Error Recovery in Services | High | 3-4h | Medium | [IMPLEMENTATION_GUIDE.md#21-implement-error-recovery-in-services](IMPLEMENTATION_GUIDE.md#21-implement-error-recovery-in-services) |
33
- | WebSocket Resilience Tests | Medium | 3-4h | Medium | [IMPLEMENTATION_GUIDE.md#22-add-websocket-resilience-tests](IMPLEMENTATION_GUIDE.md#22-add-websocket-resilience-tests) |
34
- | Status UI | Medium | 6-8h | High | [IMPLEMENTATION_GUIDE.md#23-create-status-ui-for-monitoring](IMPLEMENTATION_GUIDE.md#23-create-status-ui-for-monitoring) |
35
- | JSDoc Documentation | Medium | 4-6h | Low | [IMPLEMENTATION_GUIDE.md#31-add-comprehensive-jsdoc-documentation](IMPLEMENTATION_GUIDE.md#31-add-comprehensive-jsdoc-documentation) |
36
- | Differential Updates | Low | 4-5h | Low | [IMPLEMENTATION_GUIDE.md#32-implement-differential-device-updates](IMPLEMENTATION_GUIDE.md#32-implement-differential-device-updates) |
37
-
38
- **Total Estimated Effort**: 27-39 hours
39
-
40
- ## Getting Started
41
-
42
- ### 1. Set Up Your Environment
43
-
44
- ```bash
45
- # Ensure dependencies are installed
46
- npm install
47
-
48
- # Verify everything builds
49
- npm run build
50
-
51
- # Run tests to ensure nothing is broken
52
- npm test
53
-
54
- # Check linting
55
- npm run lint
56
- ```
57
-
58
- All should pass ✅
59
-
60
- ### 2. Choose a Task
61
-
62
- I recommend starting with these in order:
63
-
64
- 1. **OAuth Integration Tests** (High impact, foundational for quality)
65
- 2. **Error Recovery in Services** (High impact, improves reliability)
66
- 3. **JSDoc Documentation** (Medium effort, improves maintainability)
67
-
68
- ### 3. Follow the Implementation Guide
69
-
70
- Each task in [IMPLEMENTATION_GUIDE.md](docs/IMPLEMENTATION_GUIDE.md) includes:
71
- - ✅ Detailed implementation steps
72
- - ✅ Code samples (copy-paste ready)
73
- - ✅ File structure
74
- - ✅ Testing procedures
75
- - ✅ Integration instructions
76
-
77
- ### 4. Example: Adding OAuth Tests
78
-
79
- From [IMPLEMENTATION_GUIDE.md](docs/IMPLEMENTATION_GUIDE.md):
80
-
81
- ```bash
82
- # 1. Install dependencies
83
- npm install --save-dev express @types/express
84
-
85
- # 2. Create mock server (code provided in guide)
86
- # Create: test/mocks/oauth-mock-server.ts
87
-
88
- # 3. Create integration tests (code provided in guide)
89
- # Create: test/integration/oauth-developer-portal.test.ts
90
- # Create: test/integration/oauth-mobile-app.test.ts
91
-
92
- # 4. Run tests
93
- npm test -- test/integration/oauth-developer-portal.test.ts
94
- ```
95
-
96
- ## Using Utilities Already Created
97
-
98
- ### Retry Utility
99
-
100
- ```typescript
101
- import {retryWithBackoff} from '../utils/retry';
102
-
103
- // In your service method
104
- async handleTargetStateSet(value: CharacteristicValue) {
105
- await retryWithBackoff(
106
- async () => {
107
- await this.controller.setDeviceData(/* ... */);
108
- },
109
- {
110
- maxRetries: 3,
111
- onRetry: (attempt, error) => {
112
- this.platform.log.warn(`Retry ${attempt}: ${error.message}`);
113
- },
114
- },
115
- );
116
- }
117
- ```
118
-
119
- ### Device Tracker
120
-
121
- ```typescript
122
- import {DeviceTracker} from '../api/daikin-device-tracker';
123
-
124
- // In DaikinCloudDevice
125
- private tracker = new DeviceTracker();
126
-
127
- updateData(newData: GatewayDevice) {
128
- if (this.tracker.hasChanges(newData)) {
129
- // Only update if changed
130
- this.deviceData = newData;
131
- this.tracker.updateState(newData);
132
- }
133
- }
134
- ```
135
-
136
- ### Zod Validation
137
-
138
- ```typescript
139
- import {validateData, GatewayDeviceSchema} from '../api/daikin-schemas';
140
-
141
- // Validate API response
142
- const device = validateData(
143
- GatewayDeviceSchema,
144
- apiResponse,
145
- 'device data',
146
- );
147
- ```
148
-
149
- ## Development Workflow
150
-
151
- ### Making Changes
152
-
153
- ```bash
154
- # 1. Create feature branch
155
- git checkout -b feature/oauth-tests
156
-
157
- # 2. Make changes following the implementation guide
158
-
159
- # 3. Test your changes
160
- npm run build
161
- npm run lint
162
- npm test
163
-
164
- # 4. Commit (use conventional commits)
165
- git add .
166
- git commit -m "test(oauth): add integration tests for OAuth flows"
167
-
168
- # 5. Push and create PR
169
- git push origin feature/oauth-tests
170
- ```
171
-
172
- ### Conventional Commit Format
173
-
174
- ```
175
- <type>(<scope>): <description>
176
-
177
- [optional body]
178
- ```
179
-
180
- **Types**: `feat`, `fix`, `docs`, `test`, `refactor`, `chore`, `perf`, `ci`
181
-
182
- **Scopes**: `api`, `service`, `accessory`, `feature`, `device`, `config`, `utils`, `build`
183
-
184
- ## Progress Tracking
185
-
186
- ### Current Status
187
-
188
- - **Phase 1**: ✅ 100% Complete (8/8 tasks)
189
- - **Phase 2**: ⏳ 25% Complete (1/4 tasks)
190
- - **Phase 3**: ⏳ 50% Complete (2/4 tasks)
191
- - **Overall**: ✅ 60% Complete (8/14 tasks)
192
-
193
- ### Update Progress
194
-
195
- Edit [IMPROVEMENTS_SUMMARY.md](docs/IMPROVEMENTS_SUMMARY.md) after completing each task:
196
-
197
- ```markdown
198
- ## ✅ Completed Improvements (9/14)
199
-
200
- ### Phase 1 Remaining Tasks
201
-
202
- #### 1.6 ✅ OAuth Integration Tests
203
- **Status**: Completed
204
- **Date**: 2026-01-XX
205
- **Changes:**
206
- - Added mock OAuth server
207
- - Created integration tests for Developer Portal
208
- - Created integration tests for Mobile App
209
- ...
210
- ```
211
-
212
- ## Getting Help
213
-
214
- ### Documentation References
215
-
216
- 1. **System Architecture**: [ARCHITECTURE.md](docs/ARCHITECTURE.md)
217
- - Understand how components interact
218
- - Find the files you need to modify
219
-
220
- 2. **Implementation Guide**: [IMPLEMENTATION_GUIDE.md](docs/IMPLEMENTATION_GUIDE.md)
221
- - Step-by-step instructions
222
- - Code samples for each task
223
-
224
- 3. **Development Workflows**: [CLAUDE.md](../CLAUDE.md)
225
- - Build and test commands
226
- - Commit conventions
227
- - Common development tasks
228
-
229
- ### Code Examples
230
-
231
- All remaining tasks have **complete code examples** in the implementation guide. You can literally copy-paste and adapt.
232
-
233
- ### Testing
234
-
235
- Each improvement includes testing instructions:
236
-
237
- ```bash
238
- # Unit tests
239
- npm test -- path/to/your.test.ts
240
-
241
- # Watch mode for development
242
- npm test -- --watch path/to/your.test.ts
243
-
244
- # Coverage
245
- npm test -- --coverage
246
- ```
247
-
248
- ## Quality Checklist
249
-
250
- Before committing each improvement:
251
-
252
- - [ ] Code builds without errors (`npm run build`)
253
- - [ ] Lint passes (`npm run lint`)
254
- - [ ] Tests pass (`npm test`)
255
- - [ ] New code has tests (aim for 70%+ coverage)
256
- - [ ] JSDoc added for public APIs
257
- - [ ] Documentation updated if needed
258
- - [ ] IMPROVEMENTS_SUMMARY.md updated
259
-
260
- ## Time Estimates
261
-
262
- ### Realistic Schedule
263
-
264
- **Option 1: Part-time (10h/week)**
265
- - Week 1-2: OAuth tests + Error recovery (7-10h)
266
- - Week 3: WebSocket tests + Start JSDoc (7-10h)
267
- - Week 4: Complete JSDoc + Status UI start (10h)
268
- - Week 5-6: Complete Status UI + Differential updates (10-13h)
269
-
270
- **Total**: 5-6 weeks part-time
271
-
272
- **Option 2: Full-time sprint (40h/week)**
273
- - Days 1-2: OAuth tests + Error recovery + WebSocket tests (10-14h)
274
- - Days 3-4: JSDoc documentation + Differential updates (8-11h)
275
- - Days 5-7: Status UI (6-8h)
276
- - Buffer: 6-6h
277
-
278
- **Total**: 1 week full-time
279
-
280
- ## FAQ
281
-
282
- ### Q: Do I have to do all remaining tasks?
283
-
284
- **A**: No! Each task is independent. Pick the ones most valuable to you:
285
- - **For reliability**: Error recovery + WebSocket tests
286
- - **For monitoring**: Status UI
287
- - **For maintenance**: JSDoc documentation
288
- - **For performance**: Differential updates
289
-
290
- ### Q: Can I modify the implementation approach?
291
-
292
- **A**: Yes! The implementation guide provides recommended approaches, but you can adapt them to your preferences. The key goals are:
293
- - Maintain backward compatibility
294
- - Add tests for new code
295
- - Follow TypeScript/ESLint conventions
296
-
297
- ### Q: What if I get stuck?
298
-
299
- **A**:
300
- 1. Check [ARCHITECTURE.md](docs/ARCHITECTURE.md) for system context
301
- 2. Check [IMPLEMENTATION_GUIDE.md](docs/IMPLEMENTATION_GUIDE.md) for detailed steps
302
- 3. Look at existing code patterns (e.g., how tests are structured)
303
- 4. The utilities are already created and ready to use
304
-
305
- ### Q: How do I know I'm done?
306
-
307
- **A**: When:
308
- - All tests pass
309
- - Build succeeds
310
- - Lint passes
311
- - Documentation is updated
312
- - IMPROVEMENTS_SUMMARY.md reflects completion
313
-
314
- ## Key Files Reference
315
-
316
- ### Source Code
317
- - `src/api/` - API clients, OAuth, WebSocket
318
- - `src/services/` - HAP services (where to add error recovery)
319
- - `src/utils/` - Utilities (retry, update-mapper, validation)
320
- - `src/config/` - Configuration management
321
-
322
- ### Tests
323
- - `test/unit/` - Unit tests
324
- - `test/integration/` - Integration tests (create OAuth tests here)
325
- - `test/mocks/` - Mock objects (create OAuth mock server here)
326
- - `test/fixtures/` - Test data
327
-
328
- ### Documentation
329
- - `ARCHITECTURE.md` - How the system works
330
- - `IMPLEMENTATION_GUIDE.md` - How to implement remaining work
331
- - `IMPROVEMENTS_SUMMARY.md` - What's done and what's left
332
- - `CLAUDE.md` - Development workflows and conventions
333
-
334
- ## Success Criteria
335
-
336
- You'll know you're successful when:
337
-
338
- 1. ✅ Test coverage increases (target: 70%+)
339
- 2. ✅ Error handling is robust with retry logic
340
- 3. ✅ WebSocket connections recover gracefully
341
- 4. ✅ Users can monitor plugin health via UI
342
- 5. ✅ Code is well-documented with JSDoc
343
- 6. ✅ Device updates are efficient (differential)
344
-
345
- ---
346
-
347
- ## Quick Start Commands
348
-
349
- ```bash
350
- # Start working on OAuth tests
351
- git checkout -b feature/oauth-tests
352
- npm install --save-dev express @types/express
353
- # Then follow IMPLEMENTATION_GUIDE.md section 1.6
354
-
355
- # Start working on error recovery
356
- git checkout -b feature/error-recovery
357
- # Then follow IMPLEMENTATION_GUIDE.md section 2.1
358
-
359
- # Start working on JSDoc
360
- git checkout -b docs/jsdoc
361
- # Then follow IMPLEMENTATION_GUIDE.md section 3.1
362
- ```
363
-
364
- ---
365
-
366
- **Remember**: The hard work (analysis, planning, utilities) is done. The implementation guide gives you copy-paste code. You're set up for success! 🚀
367
-
368
- *Last Updated: 2026-01-10*