@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
package/package.json CHANGED
@@ -2,12 +2,12 @@
2
2
  "displayName": "Daikin Cloud",
3
3
  "platformname": "daikincloud",
4
4
  "name": "@mp-consulting/homebridge-daikin-cloud",
5
- "version": "1.3.6",
5
+ "version": "1.3.7",
6
6
  "description": "Integrate with the Daikin Cloud to control your Daikin air conditioning via the cloud",
7
- "license": "Apache-2.0",
7
+ "license": "(Apache-2.0 AND MIT)",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git://github.com/mp-consulting/homebridge-daikin-cloud.git"
10
+ "url": "git+https://github.com/mp-consulting/homebridge-daikin-cloud.git"
11
11
  },
12
12
  "bugs": {
13
13
  "url": "https://github.com/mp-consulting/homebridge-daikin-cloud/issues"
@@ -20,11 +20,13 @@
20
20
  "customUi": true,
21
21
  "customUiPath": "./homebridge-ui",
22
22
  "scripts": {
23
- "test": "jest",
24
- "test:updateSnapshots": "jest --updateSnapshot",
25
- "lint": "eslint 'src/**/*.ts' --max-warnings=0",
23
+ "test": "vitest run",
24
+ "test:watch": "vitest",
25
+ "test:coverage": "vitest run --coverage",
26
+ "lint": "eslint . --max-warnings=0",
26
27
  "watch": "npm run build && npm link && nodemon",
27
28
  "build": "rimraf ./dist && tsc",
29
+ "prepublishOnly": "npm run lint && npm run build",
28
30
  "release": "npm publish",
29
31
  "release:beta": "npm publish --tag beta"
30
32
  },
@@ -37,26 +39,27 @@
37
39
  "zod": "^3.23.8"
38
40
  },
39
41
  "devDependencies": {
40
- "@types/jest": "^29.5.4",
41
- "@types/node": "^20.14.6",
42
+ "@eslint/js": "^9.39.2",
43
+ "@types/node": "^24.0.0",
42
44
  "@types/ws": "^8.18.1",
43
- "@typescript-eslint/eslint-plugin": "^5.30.7",
44
- "@typescript-eslint/parser": "^5.30.7",
45
- "eslint": "^8.20.0",
45
+ "@vitest/coverage-v8": "^4.0.18",
46
+ "eslint": "^9.39.2",
46
47
  "hap-nodejs": "^1.1.0",
47
- "homebridge": "^1.8.4",
48
- "homebridge-config-ui-x": "^4.56.4",
49
- "jest": "^29.7.0",
50
- "nodemon": "^3.0.1",
51
- "rimraf": "^3.0.2",
52
- "ts-jest": "^29.1.1",
53
- "ts-node": "^10.3.0",
54
- "typescript": "^4.4.4"
48
+ "homebridge": "^2.0.0-beta.55",
49
+ "homebridge-config-ui-x": "^5.15.0",
50
+ "nodemon": "^3.1.11",
51
+ "rimraf": "^6.1.0",
52
+ "typescript": "^5.9.3",
53
+ "typescript-eslint": "^8.53.1",
54
+ "vitest": "^4.0.18"
55
55
  },
56
- "funding": [
57
- {
58
- "type": "paypal",
59
- "url": "https://www.paypal.me/MickaelPalma"
60
- }
56
+ "funding": {
57
+ "type": "paypal",
58
+ "url": "https://paypal.me/mickaelpalma"
59
+ },
60
+ "files": [
61
+ "dist",
62
+ "homebridge-ui",
63
+ "config.schema.json"
61
64
  ]
62
65
  }
@@ -1,3 +0,0 @@
1
- {
2
- "coAuthoredBy": false
3
- }
@@ -1,24 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(npm test)",
5
- "Bash(npm run lint)",
6
- "Bash(curl:*)",
7
- "Bash(npm run build:*)",
8
- "Bash(grep:*)",
9
- "Bash(python3:*)",
10
- "Bash(npm test:*)",
11
- "Bash(timeout 60 npm test -- test/integration/air-conditioning.test.ts --testTimeout=30000)",
12
- "Bash(npm install)",
13
- "mcp__chrome-devtools__list_pages",
14
- "Bash(ls:*)",
15
- "Bash(git config:*)",
16
- "Bash(FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch:*)",
17
- "Bash(git stash:*)",
18
- "Bash(git add:*)",
19
- "Bash(git commit:*)",
20
- "Bash(gh pr view:*)",
21
- "Bash(gh pr:*)"
22
- ]
23
- }
24
- }
package/CHANGELOG.md DELETED
@@ -1,114 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [1.3.6] - 2026-02-21
9
-
10
- ### Fixed
11
-
12
- - **`holidayMode` schema mismatch**: Corrected Zod schema and TypeScript type for `holidayMode` — the Daikin API returns `value` as an object (`{ enabled: boolean, startDate?, endDate? }`) not a string, preventing all devices from loading on startup
13
- - **Error mutation crash**: Fixed `TypeError: Cannot set property message of [object Object] which has only a getter` in `discoverDevices` by avoiding mutation of the `Error.message` property
14
-
15
- ### Changed
16
-
17
- - Updated Mobile App daily API rate limit from 5000 to 3000 across all documentation, UI labels, and code comments to reflect the current Daikin Cloud limit
18
-
19
- ## [1.3.5] - 2026-01-10
20
-
21
- ### Fixed
22
-
23
- - **Device Visibility initialization**: Fixed "Token expired or invalid" error in Device Visibility section while Discovered Devices worked correctly. Settings.load() now waits for AuthMode initialization to complete before loading device toggles, ensuring the correct authentication token is used.
24
-
25
- ## [1.3.4] - 2026-01-10
26
-
27
- ### Fixed
28
-
29
- - **UI error message display**: Device Visibility section now displays specific error messages from the backend instead of generic text. Users can now see helpful messages distinguishing between authentication failures and empty device lists, making troubleshooting easier.
30
-
31
- ## [1.3.3] - 2026-01-10
32
-
33
- ### Fixed
34
-
35
- - **UI initialization race condition**: Fixed "Token expired or invalid" error on initial UI load. The device list now waits for `AuthMode` initialization to complete before fetching devices. Backend now gracefully falls back to active token if the requested mode's token is unavailable, ensuring device list loads even during initialization.
36
-
37
- ## [1.3.2] - 2026-01-10
38
-
39
- ### Fixed
40
-
41
- - **UI JavaScript error**: Fixed "Can't find variable: AuthModeManager" error by correcting variable reference to `AuthMode`. This error prevented the device list from loading in the plugin UI.
42
-
43
- ## [1.3.1] - 2026-01-10
44
-
45
- ### Fixed
46
-
47
- - **UI device list authentication**: Fixed `/devices/list` endpoint to use the token matching the configured `authMode` instead of always prioritizing mobile token. Previously, if both mobile_app and developer_portal tokens existed, the endpoint would always use the mobile token regardless of the configured authMode setting, causing authentication mismatches.
48
-
49
- ## [1.3.0] - 2026-01-10
50
-
51
- ### Added
52
-
53
- - **Strict TypeScript checking**: Enabled `strict`, `noImplicitAny`, `strictNullChecks`, `strictFunctionTypes`, and `strictPropertyInitialization` for improved type safety
54
- - **Runtime validation with Zod**: Added comprehensive validation schemas for API responses, WebSocket messages, and configuration
55
- - Token set validation
56
- - Device data validation
57
- - Configuration validation with helpful error messages
58
- - **Utility modules** for improved reliability:
59
- - `retry.ts`: Exponential backoff retry logic with configurable options
60
- - `daikin-device-tracker.ts`: Device state tracking with change detection and error history
61
- - **Comprehensive documentation** in `docs/` folder:
62
- - `ARCHITECTURE.md`: System architecture, component design, and extension guides
63
- - `IMPLEMENTATION_GUIDE.md`: Step-by-step guide for future improvements
64
- - `IMPROVEMENTS_SUMMARY.md`: Executive summary of completed work
65
- - `NEXT_STEPS.md`: Quick-start guide for continuing development
66
- - **Enhanced CLAUDE.md**: Project-specific development guidelines and workflows
67
-
68
- ### Changed
69
-
70
- - Consolidated WebSocket update logic using UpdateMapper (removed 180+ lines of duplication)
71
- - Updated GitHub Actions workflows from v2/v3 to v4 (removed deprecation warnings)
72
- - Improved test coverage with strict TypeScript compatibility
73
-
74
- ### Fixed
75
-
76
- - 2 implicit `any` type errors in daikin-cloud.repository.ts
77
- - Test compatibility issues with strict TypeScript mode
78
- - UpdateMapper type compatibility issue
79
-
80
- ### Security
81
-
82
- - Verified token file permissions (already secure at mode 0o600)
83
- - Updated CI/CD dependencies to latest versions
84
-
85
- ### Documentation
86
-
87
- - Moved all architectural and implementation documentation to `docs/` folder
88
- - Enhanced project documentation for maintainers and contributors
89
- - Added code examples and usage patterns for utilities
90
-
91
- ## [1.2.5] - 2026-01-10
92
-
93
- ### Fixed
94
-
95
- - Fix API request format for temperature control to match mobile app format
96
- - Path parameter now sent in request body instead of URL, resolving 504 Gateway Timeout errors when setting temperature
97
-
98
- ## [1.2.4] - 2026-01-09
99
-
100
- ### Fixed
101
-
102
- - Handle API gateway timeout errors (502, 503, 504) with automatic retry and exponential backoff
103
- - Requests now retry up to 3 times before failing, resolving most transient Daikin API issues
104
-
105
- ## [1.2.3] - 2026-01-09
106
-
107
- ### Fixed
108
-
109
- - Check getData value property instead of result object in service
110
- - Enable skipped tests and fix test isolation
111
-
112
- ### Added
113
-
114
- - Automatic token refresh with exponential backoff for 401 errors
package/CLAUDE.md DELETED
@@ -1,269 +0,0 @@
1
- # Claude Code Settings
2
-
3
- ## Project Overview
4
-
5
- This is a Homebridge plugin for Daikin Cloud (Onecta) integration that allows controlling Daikin air conditioning units through Apple HomeKit. The plugin supports both Developer Portal and Mobile App authentication methods.
6
-
7
- **Key Technologies:**
8
- - TypeScript (target: ESNext)
9
- - Homebridge Plugin API
10
- - HAP-nodejs (HomeKit Accessory Protocol)
11
- - Jest for testing
12
- - ESLint for code quality
13
-
14
- ## Git Settings
15
-
16
- - `coAuthoredBy`: false
17
-
18
- ## Git Commit Convention
19
-
20
- Use conventional commits format for all commit messages:
21
-
22
- ```
23
- <type>(<scope>): <description>
24
-
25
- [optional body]
26
-
27
- [optional footer]
28
- ```
29
-
30
- ### Types
31
- - `feat`: New feature
32
- - `fix`: Bug fix
33
- - `docs`: Documentation changes
34
- - `style`: Code style changes (formatting, semicolons, etc.)
35
- - `refactor`: Code refactoring (no functional changes)
36
- - `test`: Adding or updating tests
37
- - `chore`: Maintenance tasks, dependencies, build changes
38
- - `perf`: Performance improvements
39
- - `ci`: CI/CD changes
40
-
41
- ### Scopes
42
- Common scopes used in this project:
43
- - `api`: Daikin API client, OAuth, WebSocket
44
- - `service`: Climate control, hot water tank services
45
- - `accessory`: Air conditioning, Altherma accessories
46
- - `feature`: Feature modules (modes like powerful, econo, etc.)
47
- - `device`: Device profiles, capability detection
48
- - `config`: Configuration management
49
- - `utils`: Utility functions
50
- - `build`: Build system and TypeScript configuration
51
- - `deps`: Dependency updates
52
-
53
- ### Examples
54
- - `feat(api): add device capability detection`
55
- - `fix(service): resolve temperature validation warning`
56
- - `chore(deps): update dependencies`
57
- - `refactor(features): extract feature modules from service`
58
- - `test(utils): add comprehensive StructuredLogger tests`
59
-
60
- ## Code Style Guidelines
61
-
62
- ### TypeScript & Code Quality
63
-
64
- 1. **Indentation**: Use 4 spaces (enforced by ESLint)
65
- 2. **Quotes**: Use single quotes for strings
66
- 3. **Semicolons**: Optional but should be consistent
67
- 4. **Trailing commas**: Required in multiline objects/arrays
68
- 5. **Type safety**:
69
- - `strict: true` in tsconfig
70
- - `noImplicitAny: false` (be mindful of types)
71
- - Prefer explicit types for public APIs
72
-
73
- ### ESLint Rules
74
- The project uses `@typescript-eslint` with custom rules:
75
- - No `console.log` - use Homebridge logger instead
76
- - Prefer arrow callbacks
77
- - Always use curly braces
78
- - Enforce comma spacing
79
- - No trailing spaces
80
-
81
- ### File Organization
82
-
83
- ```
84
- src/
85
- ├── accessories/ # HAP accessories (air-conditioning, altherma)
86
- ├── api/ # Daikin API clients (OAuth, WebSocket, repository)
87
- ├── config/ # Configuration management
88
- ├── constants/ # Shared constants (API, auth, device, time)
89
- ├── device/ # Device profiles and capability detection
90
- ├── di/ # Dependency injection (service container)
91
- ├── features/ # Feature modules (modes as switches)
92
- ├── services/ # HAP services (climate control, hot water)
93
- ├── types/ # TypeScript type definitions
94
- ├── utils/ # Utility functions (logging, error handling)
95
- ├── index.ts # Plugin entry point
96
- ├── platform.ts # Main platform class
97
- └── settings.ts # Plugin settings
98
- ```
99
-
100
- ### Test Organization
101
-
102
- ```
103
- test/
104
- ├── fixtures/ # Test data (device responses)
105
- ├── mocks/ # Mock objects for testing
106
- ├── helpers/ # Test utilities
107
- ├── unit/ # Unit tests
108
- │ ├── api/
109
- │ ├── device/
110
- │ ├── services/
111
- │ └── utils/
112
- └── integration/ # Integration tests
113
- ```
114
-
115
- ## Development Workflow
116
-
117
- ### Building and Testing
118
-
119
- ```bash
120
- # Install dependencies
121
- npm install
122
-
123
- # Build TypeScript
124
- npm run build
125
-
126
- # Run linter
127
- npm run lint
128
-
129
- # Run tests
130
- npm test
131
-
132
- # Update test snapshots
133
- npm run test:updateSnapshots
134
-
135
- # Development with auto-rebuild
136
- npm run watch
137
- ```
138
-
139
- ### Testing Guidelines
140
-
141
- 1. **Write tests for new features**: All new functionality should include unit tests
142
- 2. **Update snapshots carefully**: Review snapshot changes before committing
143
- 3. **Use fixtures**: Add device response fixtures in `test/fixtures/` for new device types
144
- 4. **Mock external dependencies**: Use mocks from `test/mocks/` for API calls
145
- 5. **Test coverage**: Aim for good coverage, especially for API and service layers
146
-
147
- ### Common Development Tasks
148
-
149
- #### Adding a New Feature Mode
150
-
151
- 1. Create feature class in `src/features/modes/`
152
- 2. Extend `BaseFeature` class
153
- 3. Register in feature registry
154
- 4. Add configuration option in settings
155
- 5. Add tests in `test/unit/features/`
156
- 6. Update documentation
157
-
158
- #### Adding Device Support
159
-
160
- 1. Add device response fixture in `test/fixtures/`
161
- 2. Update capability detector if needed
162
- 3. Create/update device profile in `src/device/profiles/`
163
- 4. Add integration test
164
- 5. Document in [README.md](README.md)
165
-
166
- #### Fixing API Issues
167
-
168
- 1. Check error handling in `src/utils/error-handler.ts`
169
- 2. Review rate limiting in `src/api/daikin-cloud.repository.ts`
170
- 3. Update retry logic if needed
171
- 4. Add tests for error scenarios
172
-
173
- ## Homebridge-Specific Considerations
174
-
175
- ### Platform Plugin Structure
176
-
177
- - **Platform**: [platform.ts](src/platform.ts) - Main entry point, manages accessories
178
- - **Accessories**: [src/accessories/](src/accessories/) - HAP accessory implementations
179
- - **Services**: [src/services/](src/services/) - HAP service wrappers
180
-
181
- ### HAP Service Types Used
182
-
183
- - `HeaterCooler`: Main climate control
184
- - `TemperatureSensor`: Room temperature
185
- - `Switch`: Feature modes (powerful, econo, etc.)
186
- - `Thermostat`: Altherma heating (optional)
187
-
188
- ### Configuration Schema
189
-
190
- Configuration is managed via Homebridge UI:
191
- - `homebridge-ui/` directory contains custom UI
192
- - Config schema defined in `package.json`
193
- - Validation in [src/config/config-manager.ts](src/config/config-manager.ts)
194
-
195
- ## API Integration Notes
196
-
197
- ### Authentication Methods
198
-
199
- 1. **Developer Portal** (OAuth 2.0):
200
- - Client ID/Secret from Daikin Developer Portal
201
- - 200 API calls/day limit
202
- - Callback server for OAuth flow
203
-
204
- 2. **Mobile App** (Gigya):
205
- - Email/password authentication
206
- - 3000 API calls/day limit
207
- - WebSocket support for real-time updates
208
-
209
- ### Rate Limiting
210
-
211
- - Implemented in [daikin-cloud.repository.ts](src/api/daikin-cloud.repository.ts)
212
- - Exponential backoff for retries
213
- - Gateway timeout handling (502, 503, 504)
214
-
215
- ### WebSocket Support
216
-
217
- - Only available in Mobile App mode
218
- - Real-time device state updates
219
- - Implemented in [daikin-websocket.ts](src/api/daikin-websocket.ts)
220
-
221
- ## Debugging Tips
222
-
223
- ### Enable Debug Logging
224
-
225
- Set Homebridge debug mode:
226
- ```bash
227
- homebridge -D
228
- ```
229
-
230
- ### Common Issues
231
-
232
- 1. **Token expired**: Delete `~/.homebridge/.daikin-controller-cloud-tokenset`
233
- 2. **Device not found**: Check `excludedDevicesByDeviceId` in config
234
- 3. **WebSocket connection fails**: Verify Mobile App credentials
235
- 4. **Rate limit hit**: Increase `updateIntervalInMinutes`
236
-
237
- ### Useful Log Contexts
238
-
239
- The codebase uses structured logging:
240
- - Check [log-context.ts](src/utils/log-context.ts) for log formatting
241
- - Error handling in [error-handler.ts](src/utils/error-handler.ts)
242
-
243
- ## Release Process
244
-
245
- 1. Update version in [package.json](package.json)
246
- 2. Update [README.md](README.md) if needed
247
- 3. Run tests: `npm test`
248
- 4. Build: `npm run build`
249
- 5. Commit with version bump: `chore: bump version to X.Y.Z`
250
- 6. Tag release: `git tag vX.Y.Z`
251
- 7. Push: `git push && git push --tags`
252
- 8. Publish: `npm run release` (or `npm run release:beta`)
253
-
254
- ## Important Constraints
255
-
256
- ### Do NOT
257
- - Use `console.log` - always use Homebridge logger
258
- - Commit without running tests and linter
259
- - Add dependencies without considering bundle size
260
- - Break backward compatibility without major version bump
261
- - Hardcode sensitive data (credentials, tokens)
262
-
263
- ### DO
264
- - Follow the established directory structure
265
- - Add tests for new features
266
- - Update documentation
267
- - Use dependency injection via service container
268
- - Handle errors gracefully with user-friendly messages
269
- - Consider API rate limits in all API calls
package/config.md DELETED
@@ -1,2 +0,0 @@
1
-
2
-