homebridge-midea-platform 1.3.1-beta.1 → 1.3.1-beta.3

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 (128) hide show
  1. package/.gitattributes +3 -1
  2. package/.oxfmtrc.json +12 -0
  3. package/.oxlintrc.json +16 -0
  4. package/.release-please-manifest.json +1 -1
  5. package/.zed/settings.json +73 -7
  6. package/CHANGELOG.md +46 -15
  7. package/README.md +13 -12
  8. package/config.schema.json +2 -29
  9. package/dist/accessory/AccessoryFactory.d.ts +1 -3
  10. package/dist/accessory/AccessoryFactory.js +28 -31
  11. package/dist/accessory/AccessoryFactory.js.map +1 -1
  12. package/dist/accessory/AirConditionerAccessory.js +5 -5
  13. package/dist/accessory/AirConditionerAccessory.js.map +1 -1
  14. package/dist/core/MideaCloud.d.ts +14 -4
  15. package/dist/core/MideaCloud.js +23 -25
  16. package/dist/core/MideaCloud.js.map +1 -1
  17. package/dist/core/MideaConstants.d.ts +2 -2
  18. package/dist/core/MideaDevice.d.ts +1 -1
  19. package/dist/core/MideaDevice.js +2 -2
  20. package/dist/core/MideaDevice.js.map +1 -1
  21. package/dist/core/MideaDiscover.js +1 -1
  22. package/dist/core/MideaDiscover.js.map +1 -1
  23. package/dist/core/MideaMessage.d.ts +13 -13
  24. package/dist/core/MideaMessage.js.map +1 -1
  25. package/dist/core/MideaPacketBuilder.d.ts +2 -2
  26. package/dist/core/MideaSecurity.d.ts +9 -9
  27. package/dist/core/MideaSecurity.js.map +1 -1
  28. package/dist/core/MideaUtils.d.ts +3 -3
  29. package/dist/devices/DeviceFactory.d.ts +1 -3
  30. package/dist/devices/DeviceFactory.js +28 -31
  31. package/dist/devices/DeviceFactory.js.map +1 -1
  32. package/dist/devices/a1/MideaA1Device.js +1 -0
  33. package/dist/devices/a1/MideaA1Device.js.map +1 -1
  34. package/dist/devices/a1/MideaA1Message.d.ts +5 -5
  35. package/dist/devices/a1/MideaA1Message.js +2 -2
  36. package/dist/devices/a1/MideaA1Message.js.map +1 -1
  37. package/dist/devices/ac/MideaACDevice.d.ts +2 -2
  38. package/dist/devices/ac/MideaACDevice.js +13 -10
  39. package/dist/devices/ac/MideaACDevice.js.map +1 -1
  40. package/dist/devices/ac/MideaACMessage.d.ts +18 -18
  41. package/dist/devices/ac/MideaACMessage.js +7 -6
  42. package/dist/devices/ac/MideaACMessage.js.map +1 -1
  43. package/dist/devices/c3/MideaC3Device.js +1 -0
  44. package/dist/devices/c3/MideaC3Device.js.map +1 -1
  45. package/dist/devices/c3/MideaC3Message.d.ts +5 -5
  46. package/dist/devices/c3/MideaC3Message.js +3 -3
  47. package/dist/devices/c3/MideaC3Message.js.map +1 -1
  48. package/dist/devices/cc/MideaCCDevice.d.ts +1 -4
  49. package/dist/devices/cc/MideaCCDevice.js +40 -51
  50. package/dist/devices/cc/MideaCCDevice.js.map +1 -1
  51. package/dist/devices/cc/MideaCCMessage.d.ts +28 -107
  52. package/dist/devices/cc/MideaCCMessage.js +124 -209
  53. package/dist/devices/cc/MideaCCMessage.js.map +1 -1
  54. package/dist/devices/cd/MideaCDDevice.js +1 -0
  55. package/dist/devices/cd/MideaCDDevice.js.map +1 -1
  56. package/dist/devices/cd/MideaCDMessage.d.ts +3 -3
  57. package/dist/devices/cd/MideaCDMessage.js +2 -2
  58. package/dist/devices/cd/MideaCDMessage.js.map +1 -1
  59. package/dist/devices/ce/MideaCEDevice.js +1 -0
  60. package/dist/devices/ce/MideaCEDevice.js.map +1 -1
  61. package/dist/devices/ce/MideaCEMessage.d.ts +2 -2
  62. package/dist/devices/ce/MideaCEMessage.js +1 -1
  63. package/dist/devices/ce/MideaCEMessage.js.map +1 -1
  64. package/dist/devices/db/MideaDBDevice.js +1 -0
  65. package/dist/devices/db/MideaDBDevice.js.map +1 -1
  66. package/dist/devices/db/MideaDBMessage.d.ts +3 -3
  67. package/dist/devices/db/MideaDBMessage.js +2 -2
  68. package/dist/devices/db/MideaDBMessage.js.map +1 -1
  69. package/dist/devices/e1/MideaE1Device.js +1 -0
  70. package/dist/devices/e1/MideaE1Device.js.map +1 -1
  71. package/dist/devices/e1/MideaE1Message.d.ts +4 -4
  72. package/dist/devices/e1/MideaE1Message.js +3 -3
  73. package/dist/devices/e1/MideaE1Message.js.map +1 -1
  74. package/dist/devices/e2/MideaE2Device.js +1 -0
  75. package/dist/devices/e2/MideaE2Device.js.map +1 -1
  76. package/dist/devices/e2/MideaE2Message.d.ts +4 -4
  77. package/dist/devices/e2/MideaE2Message.js +1 -1
  78. package/dist/devices/e2/MideaE2Message.js.map +1 -1
  79. package/dist/devices/e3/MideaE3Device.js +1 -0
  80. package/dist/devices/e3/MideaE3Device.js.map +1 -1
  81. package/dist/devices/e3/MideaE3Message.d.ts +4 -4
  82. package/dist/devices/e3/MideaE3Message.js +2 -2
  83. package/dist/devices/e3/MideaE3Message.js.map +1 -1
  84. package/dist/devices/fa/MideaFADevice.js +1 -0
  85. package/dist/devices/fa/MideaFADevice.js.map +1 -1
  86. package/dist/devices/fa/MideaFAMessage.d.ts +3 -3
  87. package/dist/devices/fa/MideaFAMessage.js +2 -2
  88. package/dist/devices/fa/MideaFAMessage.js.map +1 -1
  89. package/dist/devices/fd/MideaFDDevice.js +1 -0
  90. package/dist/devices/fd/MideaFDDevice.js.map +1 -1
  91. package/dist/devices/fd/MideaFDMessage.d.ts +2 -2
  92. package/dist/devices/fd/MideaFDMessage.js +2 -2
  93. package/dist/devices/fd/MideaFDMessage.js.map +1 -1
  94. package/dist/homebridge-ui/public/index.html +176 -0
  95. package/dist/homebridge-ui/public/ui.js +6 -0
  96. package/dist/homebridge-ui/public/ui.js.map +1 -0
  97. package/dist/homebridge-ui/server.js +1 -0
  98. package/dist/platform.js +6 -7
  99. package/dist/platform.js.map +1 -1
  100. package/dist/platformUtils.d.ts +0 -7
  101. package/dist/platformUtils.js +0 -1
  102. package/dist/platformUtils.js.map +1 -1
  103. package/docs/a1.md +9 -9
  104. package/docs/ac.md +28 -25
  105. package/docs/ce.md +8 -6
  106. package/docs/download_lua.md +1 -0
  107. package/docs/e1.md +1 -1
  108. package/docs/e2.md +9 -7
  109. package/docs/e3.md +12 -10
  110. package/docs/fa.md +1 -1
  111. package/docs/fd.md +1 -1
  112. package/mise.toml +1 -1
  113. package/package.json +38 -32
  114. package/rolldown.config.ts +43 -0
  115. package/biome.json +0 -41
  116. package/dist/devices/cc/MideaCCTLV.d.ts +0 -50
  117. package/dist/devices/cc/MideaCCTLV.js +0 -105
  118. package/dist/devices/cc/MideaCCTLV.js.map +0 -1
  119. package/homebridge-ui/public/css/bootstrap.min.css +0 -6
  120. package/homebridge-ui/public/index.html +0 -655
  121. package/homebridge-ui/public/js/bootstrap.min.js +0 -1185
  122. package/homebridge-ui/server.js +0 -373
  123. package/resources/T_0000_CC_10011006_2025033001.lua +0 -2983
  124. package/resources/T_0000_CC_6.lua +0 -988
  125. package/resources/a1_00000Q1C.lua +0 -1227
  126. package/resources/ac_00000Q11.lua +0 -5148
  127. package/resources/c3_HeatPump_152832116442666.lua +0 -4681
  128. package/resources/cd_RSJ000CB.lua +0 -4983
package/.gitattributes CHANGED
@@ -1,3 +1,5 @@
1
1
  # Handle line endings automatically for files detected as text
2
2
  # and leave all files detected as binary untouched.
3
- * text=auto eol=lf
3
+ * text=auto eol=lf
4
+
5
+ resources/* linguist-vendored
package/.oxfmtrc.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "./node_modules/oxfmt/configuration_schema.json",
3
+ "printWidth": 160,
4
+ "useTabs": false,
5
+ "singleQuote": true,
6
+ "jsxSingleQuote": false,
7
+ "quoteProps": "as-needed",
8
+ "trailingComma": "all",
9
+ "semi": true,
10
+ "arrowParens": "always",
11
+ "ignorePatterns": [".zed/*", "CHANGELOG.md"]
12
+ }
package/.oxlintrc.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "plugins": ["oxc", "typescript", "node"],
4
+ "categories": {
5
+ "correctness": "warn",
6
+ "suspicious": "warn"
7
+ },
8
+ "rules": {
9
+ "no-param-reassign": "error",
10
+ "typescript/prefer-as-const": "error",
11
+ "default-param-last": "error",
12
+ "typescript/prefer-enum-initializers": "error",
13
+ "typescript/no-inferrable-types": "error",
14
+ "no-underscore-dangle": "allow"
15
+ }
16
+ }
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "1.2.10"
2
+ ".": "1.3.0"
3
3
  }
@@ -1,12 +1,78 @@
1
1
  {
2
+ "lsp": {
3
+ "oxlint": {
4
+ "initialization_options": {
5
+ "settings": {
6
+ "configPath": null,
7
+ "run": "onType",
8
+ "disableNestedConfig": false,
9
+ "fixKind": "safe_fix",
10
+ "unusedDisableDirectives": "deny",
11
+ },
12
+ },
13
+ },
14
+ "oxfmt": {
15
+ "initialization_options": {
16
+ "settings": {
17
+ "fmt.configPath": null,
18
+ "run": "onSave",
19
+ },
20
+ },
21
+ },
22
+ },
2
23
  "languages": {
3
24
  "TypeScript": {
4
- "language_servers": ["vtsls", "biome"]
5
- }
25
+ "language_servers": ["vtsls", "oxlint", "oxfmt"],
26
+ "format_on_save": "on",
27
+ "prettier": {
28
+ "allowed": false,
29
+ },
30
+ "formatter": [
31
+ {
32
+ "language_server": {
33
+ "name": "oxfmt",
34
+ },
35
+ },
36
+ ],
37
+ },
38
+ "JSON": {
39
+ "format_on_save": "on",
40
+ "prettier": {
41
+ "allowed": false,
42
+ },
43
+ "formatter": [
44
+ {
45
+ "language_server": {
46
+ "name": "oxfmt",
47
+ },
48
+ },
49
+ ],
50
+ },
51
+ "HTML": {
52
+ "format_on_save": "on",
53
+ "prettier": {
54
+ "allowed": false,
55
+ },
56
+ "formatter": [
57
+ {
58
+ "language_server": {
59
+ "name": "oxfmt",
60
+ },
61
+ },
62
+ ],
63
+ },
64
+ "Markdown": {
65
+ "format_on_save": "on",
66
+ "prettier": {
67
+ "allowed": false,
68
+ },
69
+ "formatter": [
70
+ {
71
+ "language_server": {
72
+ "name": "oxfmt",
73
+ },
74
+ },
75
+ ],
76
+ },
6
77
  },
7
- "formatter": [{ "language_server": { "name": "biome" } }],
8
- "code_actions_on_format": {
9
- "source.fixAll.biome": true,
10
- "source.organizeImports.biome": true
11
- }
12
78
  }
package/CHANGELOG.md CHANGED
@@ -1,6 +1,23 @@
1
1
  # Changelog
2
2
 
3
- # v1.2.10
3
+ ## [1.3.0](https://github.com/kovapatrik/homebridge-midea-platform/compare/v1.2.10...v1.3.0) (2026-06-30)
4
+
5
+ ### Features
6
+
7
+ - **AC:** Add option to expose humidity sensor ([#171](https://github.com/kovapatrik/homebridge-midea-platform/issues/171)) ([c928e43](https://github.com/kovapatrik/homebridge-midea-platform/commit/c928e435961331518ac6701ca97189209c6664c5))
8
+ - protocol reworks ([#178](https://github.com/kovapatrik/homebridge-midea-platform/issues/178)) ([c231ba4](https://github.com/kovapatrik/homebridge-midea-platform/commit/c231ba41282e132b93ea6b8052d20622cf928692))
9
+ - use release please ([1cb1c16](https://github.com/kovapatrik/homebridge-midea-platform/commit/1cb1c167baa8f92767897968f7873133a8a71a59))
10
+ - **AC**: added support for Out Silent Mode and ION (anion) (fixes Add deeper support for Midea Portasplit #105, AC Ioniser (Anion) Control and State Issues #146, Medea Portasplit Silent Mode #172)
11
+ - **A1**: fixed pump setting (fixes Pump Switch not working properly #136)
12
+ - **AC, A1 and CC**: feature parity with midea-local
13
+
14
+ ### Bug Fixes
15
+
16
+ - gate reconnect lifecycle logs behind logRecoverableErrors ([#170](https://github.com/kovapatrik/homebridge-midea-platform/issues/170)) ([efc1217](https://github.com/kovapatrik/homebridge-midea-platform/commit/efc12178695258843b68d3ab849f94bd579aa5ed))
17
+ - use workflow call to publish [skip ci] ([8281273](https://github.com/kovapatrik/homebridge-midea-platform/commit/828127308ba5a381b759405f045e9915326893dd))
18
+
19
+ ## v1.2.10
20
+
4
21
  - fix: added logic to persist fan speed when toggling fan related modes (like sleep mode, boost mode, etc...) in `Air Conditioner` (fixes #158)
5
22
  - feat: added separate switch for setting `Air Conditioner` fan auto mode (fixes #152)
6
23
  - feat: added basic/partial support for 0xCC `MDV WiFi Controller` (fixes #126)
@@ -8,18 +25,22 @@
8
25
  - fix: authentication and connection logic fixes (by @Ben-Diehlci)
9
26
  - feat: added option to set Thermostat as the service type for AC devices (by @Ben-Diehlci)
10
27
 
11
- # v1.2.9
28
+ ## v1.2.9
29
+
12
30
  - feat: added separate temperature sensor creation option for `Air Conditioner` (fixes #141)
13
31
 
14
- # v1.2.8
32
+ ## v1.2.8
33
+
15
34
  - fix: boost/comfort/eco mode was not working for `Air Conditioner` (fixes #154)
16
35
 
17
- # v1.2.7
36
+ ## v1.2.7
37
+
18
38
  - feat: emulate HomeKit heat and cool thresholds for `Air Conditioner` (fixes #134)
19
39
  - this allows to use HomeKit's `Auto` mode for `Air Conditioner` devices in a way Midea using it
20
40
  - fix: removed not needed screen display setter for `Air Conditioner` devices
21
41
 
22
- # v1.2.6
42
+ ## v1.2.6
43
+
23
44
  - feat: added partial support for `Fresh Air Appliance` (issue #118)
24
45
  - feat: added sleep mode switch for `Air Conditioner` (fixes #128)
25
46
  - feat: added comfort mode switch for `Air Conditioner` (fixes #132)
@@ -28,23 +49,29 @@
28
49
  - you might have duplicated accessories because of this, please delete the cached accessories for this plugin to remove them
29
50
  - you can do this from the Homebridge UI: three dots in the top right side -> Settings -> scroll down to the bottom and there will be a `Remove Single Accessory` button -> use that and remove everything which is connected to the plugin `homebridge-midea-platform`
30
51
 
31
- # v1.2.5
52
+ ## v1.2.5
53
+
32
54
  - fix: getting tokens/key for devices
33
55
  - IMPORTANT CHANGE: please read the [README](README.md#important-notice) about the change fetching the tokens
34
56
 
35
- # v1.2.4
57
+ ## v1.2.4
58
+
36
59
  - feat: added support for `Humidifiers` (fixes #114)
37
60
  - fix: mark accessories as 'Not responding' if the device is presumed offline
38
61
  - chore: changed linter and formatter to biome.js and applied all the necessary changes
39
62
 
40
- # v1.2.3
63
+ ## v1.2.3
64
+
41
65
  - fix: checking if cloud provider can be used for downloading Lua files in the discovery process
42
66
 
43
- # v1.2.2
67
+ ## v1.2.2
68
+
44
69
  - version bump to fix the npm package
45
70
 
46
- # v1.2.1
47
- ## 2024-10-26
71
+ ## v1.2.1
72
+
73
+ ### 2024-10-26
74
+
48
75
  - BREAKING CHANGE: the plugin is now following Homebridge 2.0.0 compatible. This caused a lot of eslint and import clause rewrites.
49
76
  - BREAKING CHANGE: Node version support is now `^18.20.4 || ^20.18.0 || ^22.10.0`.
50
77
  - feat: added support for `Front Load Washers` (fixes #87)
@@ -59,8 +86,10 @@
59
86
  - fix: QoL improvements and bug fixes (TCP key error, etc.)
60
87
  - chore: deleted unnecessary flags
61
88
 
62
- # v1.1.0
63
- ## 2024-07-13
89
+ ## v1.1.0
90
+
91
+ ### 2024-07-13
92
+
64
93
  - BREAKING CHANGE: `Air Conditioner` configuration changed: there is now a possibility to create an accessory which can be used to control the slats on the unit. THe configuration structure has changed. Please check [AC docs](/docs/ac.md) for more information (or just save the configuration again in the plugin settings to get the new structure).
65
94
  - feat: added support for `Fans` (fixes #74)
66
95
  - feat: added feature to turn off the display by default on power on for `Air Conditioners`
@@ -70,8 +99,10 @@
70
99
  - fix: added option to add a fan accessory to `Dehumidifiers` (fixes #89)
71
100
  - fix: wait for device response before adding it to Homebridge
72
101
 
73
- # v1.0.6
74
- ## 2024-06-15
102
+ ## v1.0.6
103
+
104
+ ### 2024-06-15
105
+
75
106
  - BREAKING CHANGE: there is a new conifguration option `fanOnlyModeSwitch` which will only turn on fan only mode. There is a possiblity to create an accessory to manage fan only mode using option `fanAccessory`. Setting fan to auto mode can be done from the fan accessory
76
107
  - fix: NetHome Plus login
77
108
  - minor quality of life improvements
package/README.md CHANGED
@@ -8,13 +8,14 @@
8
8
  [![npm](https://badgen.net/npm/v/homebridge-midea-platform)](https://www.npmjs.com/package/homebridge-midea-platform)
9
9
  [![npm](https://badgen.net/npm/dt/homebridge-midea-platform?label=downloads)](https://www.npmjs.com/package/homebridge-midea-platform)
10
10
 
11
- *Verified* plugin for Midea devices. This is implemented by building on the Homebridge platform plugin template and the work done by [@georgezhao2010](https://github.com/georgezhao2010) in the [midea_ac_lan](https://github.com/georgezhao2010/midea_ac_lan) project for Home Assistant and the project [midea-local](https://github.com/midea-lan/midea-local). Also thanks to the work done by [@mill1000](https://github.com/mill1000) in the [midea-msmart (msmart-ng)](https://github.com/mill1000/midea-msmart) project.
11
+ _Verified_ plugin for Midea devices. This is implemented by building on the Homebridge platform plugin template and the work done by [@georgezhao2010](https://github.com/georgezhao2010) in the [midea_ac_lan](https://github.com/georgezhao2010/midea_ac_lan) project for Home Assistant and the project [midea-local](https://github.com/midea-lan/midea-local). Also thanks to the work done by [@mill1000](https://github.com/mill1000) in the [midea-msmart (msmart-ng)](https://github.com/mill1000/midea-msmart) project.
12
12
 
13
13
  Pull requests and/or other offers of development assistance gratefully received.
14
14
 
15
15
  More information can be found in the [wiki](https://github.com/kovapatrik/homebridge-midea-platform/wiki).
16
16
 
17
17
  ## IMPORTANT NOTICE
18
+
18
19
  - As written by [@wuwentao](https://github.com/wuwentao) in the [midea_ac_lan repository](https://github.com/wuwentao/midea_ac_lan), Midea disabled the token fetching APIs in both Meiju and Midea SmartHome, and now it's only available using the NetHome Plus API.
19
20
  - It's expected that the token fetching in NetHome Plus API will be disabled as well.
20
21
  - Make sure you save your devices' token and key to be able to usem them in the future.
@@ -25,16 +26,16 @@ More information can be found in the [wiki](https://github.com/kovapatrik/homebr
25
26
 
26
27
  Currently supports the following devices:
27
28
 
28
- | Device | ID | Docs |
29
- |--------|----|------|
30
- | Air Conditioner | AC | [link](/docs/ac.md) |
31
- | Dehumidifier | A1 | [link](/docs/a1.md) |
32
- | Fresh Air Appliance | CE | [link](/docs/ce.md) |
33
- | Front Load Washer | DB | [link](/docs/db.md) |
34
- | Electric Water Heater | E2 | [link](/docs/e2.md) |
35
- | Gas Water Heater | E3 | [link](/docs/e3.md) |
36
- | Fan | FA | [link](/docs/fa.md) |
37
- | Humidifier | FD | [link](/docs/fd.md) |
29
+ | Device | ID | Docs |
30
+ | --------------------- | --- | ------------------- |
31
+ | Air Conditioner | AC | [link](/docs/ac.md) |
32
+ | Dehumidifier | A1 | [link](/docs/a1.md) |
33
+ | Fresh Air Appliance | CE | [link](/docs/ce.md) |
34
+ | Front Load Washer | DB | [link](/docs/db.md) |
35
+ | Electric Water Heater | E2 | [link](/docs/e2.md) |
36
+ | Gas Water Heater | E3 | [link](/docs/e3.md) |
37
+ | Fan | FA | [link](/docs/fa.md) |
38
+ | Humidifier | FD | [link](/docs/fd.md) |
38
39
 
39
40
  ### Unsupported Devices
40
41
 
@@ -52,7 +53,7 @@ Search for "midea" in [homebridge-config-ui-x](https://github.com/oznu/homebridg
52
53
  sudo npm install -g homebridge-midea-platform
53
54
  ```
54
55
 
55
- Midea device status is retrieved over your Local Area Network (LAN) and credentials are obtained from the Midea cloud services over the internet. While the plugin maintains a status cache, **use of Homebridge [child bridge](https://github.com/homebridge/homebridge/wiki/Child-Bridges)** is strongly encouraged. As noted below in the *network resiliency* section, this plugin will make multiple attempts to fulfill a request if necessary, which can take time.
56
+ Midea device status is retrieved over your Local Area Network (LAN) and credentials are obtained from the Midea cloud services over the internet. While the plugin maintains a status cache, **use of Homebridge [child bridge](https://github.com/homebridge/homebridge/wiki/Child-Bridges)** is strongly encouraged. As noted below in the _network resiliency_ section, this plugin will make multiple attempts to fulfill a request if necessary, which can take time.
56
57
 
57
58
  ## Configuration
58
59
 
@@ -2,6 +2,7 @@
2
2
  "pluginAlias": "midea-platform",
3
3
  "pluginType": "platform",
4
4
  "customUi": true,
5
+ "customUiPath": "./dist/homebridge-ui",
5
6
  "headerDisplay": "This plugin is currently experimental and under development. Please report [bugs](https://github.com/kovapatrik/homebridge-midea-platform/issues)",
6
7
  "footerDisplay": "For help please see the [homepage](https://github.com/kovapatrik/homebridge-midea-platform)",
7
8
  "singular": true,
@@ -435,33 +436,6 @@
435
436
  "title": "Fan Auto Switch",
436
437
  "description": "Toggles if the fan auto switch is created with the accessory.",
437
438
  "type": "boolean"
438
- },
439
- "indoor_units": {
440
- "title": "Indoor Units",
441
- "type": "array",
442
- "items": {
443
- "type": "object",
444
- "properties": {
445
- "addr": {
446
- "title": "Address",
447
- "type": "number"
448
- },
449
- "name": {
450
- "title": "Name",
451
- "type": "string"
452
- },
453
- "fanAccessory": {
454
- "title": "Fan Accessory",
455
- "description": "Create a separate Fan accessory for this indoor unit.",
456
- "type": "boolean"
457
- },
458
- "swingAccessory": {
459
- "title": "Swing Accessory",
460
- "description": "Create a separate swing angle accessory for this indoor unit.",
461
- "type": "boolean"
462
- }
463
- }
464
- }
465
439
  }
466
440
  }
467
441
  },
@@ -792,8 +766,7 @@
792
766
  "devices[].CC_options.nightLightSwitch",
793
767
  "devices[].CC_options.sleepModeSwitch",
794
768
  "devices[].CC_options.fanSpeedMode",
795
- "devices[].CC_options.fanAutoSwitch",
796
- "devices[].CC_options.indoor_units"
769
+ "devices[].CC_options.fanAutoSwitch"
797
770
  ]
798
771
  },
799
772
  {
@@ -13,6 +13,4 @@ import HumidifierAccessory from './HumidifierAccessory.js';
13
13
  import FreshAirApplianceAccessory from './FreshAirApplianceAccessory.js';
14
14
  import HeatPumpWaterHeaterAccessory from './HeatPumpWaterHeaterAccessory.js';
15
15
  import MDVWiFiControllerAccessory from './MDVWiFiControllerAccessory.js';
16
- export default class AccessoryFactory {
17
- static createAccessory<T extends MideaDevice>(platform: MideaPlatform, accessory: MideaAccessory, device: T, configDev: DeviceConfig): AirConditionerAccessory | DehumidifierAccessory | FrontLoadWasherAccessory | ElectricWaterHeaterAccessory | GasWaterHeaterAccessory | FanAccessory | DishwasherAccessory | HeatPumpWiFiControllerAccessory | HumidifierAccessory | FreshAirApplianceAccessory | HeatPumpWaterHeaterAccessory | MDVWiFiControllerAccessory;
18
- }
16
+ export default function createAccessory<T extends MideaDevice>(platform: MideaPlatform, accessory: MideaAccessory, device: T, configDev: DeviceConfig): AirConditionerAccessory | DehumidifierAccessory | FrontLoadWasherAccessory | ElectricWaterHeaterAccessory | GasWaterHeaterAccessory | FanAccessory | DishwasherAccessory | HeatPumpWiFiControllerAccessory | HumidifierAccessory | FreshAirApplianceAccessory | HeatPumpWaterHeaterAccessory | MDVWiFiControllerAccessory;
@@ -11,37 +11,34 @@ import HumidifierAccessory from './HumidifierAccessory.js';
11
11
  import FreshAirApplianceAccessory from './FreshAirApplianceAccessory.js';
12
12
  import HeatPumpWaterHeaterAccessory from './HeatPumpWaterHeaterAccessory.js';
13
13
  import MDVWiFiControllerAccessory from './MDVWiFiControllerAccessory.js';
14
- // biome-ignore lint/complexity/noStaticOnlyClass: static class is used for factory
15
- export default class AccessoryFactory {
16
- static createAccessory(platform, accessory, device, configDev) {
17
- switch (device.type) {
18
- case DeviceType.DEHUMIDIFIER:
19
- return new DehumidifierAccessory(platform, accessory, device, configDev);
20
- case DeviceType.AIR_CONDITIONER:
21
- return new AirConditionerAccessory(platform, accessory, device, configDev);
22
- case DeviceType.HEAT_PUMP_WIFI_CONTROLLER:
23
- return new HeatPumpWiFiControllerAccessory(platform, accessory, device, configDev);
24
- case DeviceType.FRONT_LOAD_WASHER:
25
- return new FrontLoadWasherAccessory(platform, accessory, device, configDev);
26
- case DeviceType.DISHWASHER:
27
- return new DishwasherAccessory(platform, accessory, device, configDev);
28
- case DeviceType.ELECTRIC_WATER_HEATER:
29
- return new ElectricWaterHeaterAccessory(platform, accessory, device, configDev);
30
- case DeviceType.GAS_WATER_HEATER:
31
- return new GasWaterHeaterAccessory(platform, accessory, device, configDev);
32
- case DeviceType.FAN:
33
- return new FanAccessory(platform, accessory, device, configDev);
34
- case DeviceType.HUMIDIFIER:
35
- return new HumidifierAccessory(platform, accessory, device, configDev);
36
- case DeviceType.FRESH_AIR_APPLIANCE:
37
- return new FreshAirApplianceAccessory(platform, accessory, device, configDev);
38
- case DeviceType.HEAT_PUMP_WATER_HEATER:
39
- return new HeatPumpWaterHeaterAccessory(platform, accessory, device, configDev);
40
- case DeviceType.MDV_WIFI_CONTROLLER:
41
- return new MDVWiFiControllerAccessory(platform, accessory, device, configDev);
42
- default:
43
- throw new Error(`Unsupported device type: ${device.type}`);
44
- }
14
+ export default function createAccessory(platform, accessory, device, configDev) {
15
+ switch (device.type) {
16
+ case DeviceType.DEHUMIDIFIER:
17
+ return new DehumidifierAccessory(platform, accessory, device, configDev);
18
+ case DeviceType.AIR_CONDITIONER:
19
+ return new AirConditionerAccessory(platform, accessory, device, configDev);
20
+ case DeviceType.HEAT_PUMP_WIFI_CONTROLLER:
21
+ return new HeatPumpWiFiControllerAccessory(platform, accessory, device, configDev);
22
+ case DeviceType.FRONT_LOAD_WASHER:
23
+ return new FrontLoadWasherAccessory(platform, accessory, device, configDev);
24
+ case DeviceType.DISHWASHER:
25
+ return new DishwasherAccessory(platform, accessory, device, configDev);
26
+ case DeviceType.ELECTRIC_WATER_HEATER:
27
+ return new ElectricWaterHeaterAccessory(platform, accessory, device, configDev);
28
+ case DeviceType.GAS_WATER_HEATER:
29
+ return new GasWaterHeaterAccessory(platform, accessory, device, configDev);
30
+ case DeviceType.FAN:
31
+ return new FanAccessory(platform, accessory, device, configDev);
32
+ case DeviceType.HUMIDIFIER:
33
+ return new HumidifierAccessory(platform, accessory, device, configDev);
34
+ case DeviceType.FRESH_AIR_APPLIANCE:
35
+ return new FreshAirApplianceAccessory(platform, accessory, device, configDev);
36
+ case DeviceType.HEAT_PUMP_WATER_HEATER:
37
+ return new HeatPumpWaterHeaterAccessory(platform, accessory, device, configDev);
38
+ case DeviceType.MDV_WIFI_CONTROLLER:
39
+ return new MDVWiFiControllerAccessory(platform, accessory, device, configDev);
40
+ default:
41
+ throw new Error(`Unsupported device type: ${device.type}`);
45
42
  }
46
43
  }
47
44
  //# sourceMappingURL=AccessoryFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccessoryFactory.js","sourceRoot":"","sources":["../../src/accessory/AccessoryFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,C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AA4B,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAkC,EAAE,SAAS,CAAC,CAAC;QAC9G,KAAK,UAAU,CAAC,gBAAgB;YAC9B,OAAO,IAAI,uBAAuB,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAkC,EAAE,SAAS,CAAC,CAAC;QACzG,KAAK,UAAU,CAAC,GAAG;YACjB,OAAO,IAAI,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAkC,EAAE,SAAS,CAAC,CAAC;QAC9F,KAAK,UAAU,CAAC,UAAU;YACxB,OAAO,IAAI,mBAAmB,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAkC,EAAE,SAAS,CAAC,CAAC;QACrG,KAAK,UAAU,CAAC,mBAAmB;YACjC,OAAO,IAAI,0BAA0B,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAkC,EAAE,SAAS,CAAC,CAAC;QAC5G,KAAK,UAAU,CAAC,sBAAsB;YACpC,OAAO,IAAI,4BAA4B,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAkC,EAAE,SAAS,CAAC,CAAC;QAC9G,KAAK,UAAU,CAAC,mBAAmB;YACjC,OAAO,IAAI,0BAA0B,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAkC,EAAE,SAAS,CAAC,CAAC;QAC5G;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC"}
@@ -552,10 +552,10 @@ export default class AirConditionerAccessory extends BaseAccessory {
552
552
  }
553
553
  return this.platform.Characteristic.CurrentHeatingCoolingState.OFF;
554
554
  }
555
- if (!this.device.attributes.POWER || !this.device.attributes.MODE) {
555
+ if (!this.device.attributes.POWER || this.device.attributes.MODE === ACMode.OFF) {
556
556
  return this.platform.Characteristic.CurrentHeaterCoolerState.INACTIVE;
557
557
  }
558
- const isPossiblyCooling = [ACMode.COOLING, ACMode.AUTO].includes(this.device.attributes.MODE);
558
+ const isPossiblyCooling = [ACMode.COOLING, ACMode.DRY, ACMode.AUTO].includes(this.device.attributes.MODE);
559
559
  const isPossiblyHeating = [ACMode.HEATING, ACMode.AUTO].includes(this.device.attributes.MODE) && this.configDev.AC_options.heatingCapable;
560
560
  const currentTemperature = Number(this.getCurrentTemperature());
561
561
  const heatingThresholdTemperature = Number(this.getHeatingThresholdTemperature());
@@ -575,17 +575,17 @@ export default class AirConditionerAccessory extends BaseAccessory {
575
575
  }
576
576
  switch (this.device.attributes.MODE) {
577
577
  case ACMode.COOLING:
578
+ case ACMode.DRY:
578
579
  return this.platform.Characteristic.TargetHeatingCoolingState.COOL;
579
580
  case ACMode.HEATING:
580
581
  return this.platform.Characteristic.TargetHeatingCoolingState.HEAT;
581
- case ACMode.AUTO:
582
- return this.platform.Characteristic.TargetHeatingCoolingState.AUTO;
583
582
  default:
584
583
  return this.platform.Characteristic.TargetHeatingCoolingState.AUTO;
585
584
  }
586
585
  }
587
586
  switch (this.device.attributes.MODE) {
588
587
  case ACMode.COOLING:
588
+ case ACMode.DRY:
589
589
  return this.platform.Characteristic.TargetHeaterCoolerState.COOL;
590
590
  case ACMode.HEATING:
591
591
  return this.platform.Characteristic.TargetHeaterCoolerState.HEAT;
@@ -791,7 +791,7 @@ export default class AirConditionerAccessory extends BaseAccessory {
791
791
  await this.device.set_attribute({ POWER: true, MODE: ACMode.DRY });
792
792
  }
793
793
  else {
794
- await this.device.set_attribute({ POWER: false, MODE: ACMode.OFF });
794
+ await this.device.set_attribute({ POWER: false });
795
795
  }
796
796
  }
797
797
  getBoostMode() {