homebridge-melcloud-control 2.3.0-beta.30 → 2.3.0-beta.32

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.
package/CHANGELOG.md CHANGED
@@ -27,7 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
27
27
 
28
28
  - removed from config.json `ataDisableAutoMode`, `ataDisableHeatMode`, `ataAutoHeatMode`
29
29
  - added to config.json `ataHeatDryFanMode`, `ataCoolDryFanMode`, `ataAutoDryFanMode`
30
- - added [#132](https://github.com/grzegorz914/homebridge-melcloud-control/issues/132)
30
+ - added individual operating mode assingn for `Heat/Cool/Auto`, [#132](https://github.com/grzegorz914/homebridge-melcloud-control/issues/132)
31
+ - unfortunatelly disabled operating mode cannot be hiden in HomeKit app due to HomeKit app limitations
31
32
  - cleanup
32
33
  - config schema updated
33
34
 
package/README.md CHANGED
@@ -32,8 +32,9 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
32
32
  * Support temperature display units `Celsius/Fahrenheit`.
33
33
  * Support hide device by `DeviceId`.
34
34
  * Support control device `Presets`.
35
- * Support direct device control creating extra `Buttons`, applied for all devices of same type in account.
36
- * Support identify all states of device creating `Sensors`, applied for all devices of same type in account.
35
+ * Support assing inividual operating mode for `Heat/Cool/Auto`.
36
+ * Support direct device control using extra `Buttons`, applied for all devices of same type in account.
37
+ * Support detect all device states using extra `Sensors`, applied for all devices of same type in account.
37
38
  * Support automations, shortcuts and Siri.
38
39
  * Support external integrations, [RESTFul](https://github.com/grzegorz914/homebridge-melcloud-control?tab=readme-ov-file#restful-integration), [MQTT](https://github.com/grzegorz914/homebridge-melcloud-control?tab=readme-ov-file#mqtt-integration).
39
40
 
@@ -48,7 +49,6 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
48
49
  * Swing mode `AUTO/SWING`.
49
50
  * Physical lock controls `LOCK/UNLOCK`.
50
51
  * Temperature display unit `°F/°C`.
51
- * Assign operation mode for `HEAT/COOL/AUTO`.
52
52
  * Thermostat:
53
53
  * Power `ON/OFF`.
54
54
  * Operating mode `POWER OFF/HEAT/COOL/AUTO`.
@@ -164,7 +164,6 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
164
164
  * Run this plugin as a [Child Bridge](https://github.com/homebridge/homebridge/wiki/Child-Bridges) (Highly Recommended), this prevent crash Homebridge if plugin crashes.
165
165
  * Install and use [Homebridge Config UI X](https://github.com/homebridge/homebridge-config-ui-x/wiki) to configure this plugin (Highly Recommended).
166
166
  * The `sample-config.json` can be edited and used as an alternative.
167
- * Be sure to always make a backup copy of your config.json file before making any changes to it.
168
167
 
169
168
  <p align="center">
170
169
  <a href="https://github.com/grzegorz914/homebridge-melcloud-control"><img src="https://raw.githubusercontent.com/grzegorz914/homebridge-melcloud-control/main/graphics/ustawienia.png" width="840"></a>
@@ -177,9 +176,9 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
177
176
  | `passwd` | Here set the MELCloud password. |
178
177
  | `language` | Here select the MELCloud language. |
179
178
  | `ataDisplayMode` | Here select device control mode `Heater/Cooler`, `Thermostat`. |
180
- | `ataHeatDryFanMode` | Here select operation mode for `Heat`, if the mode is not supported then will be disabled. |
181
- | `ataCoolDryFanMode` | Here select operation mode for `Cool`, if the mode is not supported then will be disabled. |
182
- | `ataAutoDryFanMode` | Here select operation mode for `Auto`, if the mode is not supported then will be disabled. |
179
+ | `ataHeatDryFanMode` | Here select the operatiing mode for `Heat`, if this mode is not supported, it will be disabled. |
180
+ | `ataCoolDryFanMode` | Here select the operatiing mode for `Cool`, if this mode is not supported, it will be disabled. |
181
+ | `ataAutoDryFanMode` | Here select the operatiing mode for `Auto`, if this mode is not supported, it will be disabled.. |
183
182
  | `ataTemperatureSensor` | This enable extra `Room` temperature sensors to use with automations in HomeKit app. |
184
183
  | `ataTemperatureSensorOutdoor` | This enable extra `Outdoor` temperature sensors to use with automations in HomeKit app. |
185
184
  | `ataPresets` | This enable extra buttons for configured presets and display it in HomeKit app. |
@@ -224,7 +224,7 @@
224
224
  ]
225
225
  }
226
226
  ],
227
- "description": "Select main control mode displayed in HomeKit app.",
227
+ "description": "Select device control mode displayed in HomeKit app.",
228
228
  "required": true
229
229
  },
230
230
  "ataHeatDryFanMode": {
@@ -259,7 +259,7 @@
259
259
  ]
260
260
  }
261
261
  ],
262
- "description": "Select operation mode for Heat, if the mode is not supported then will be disabled.",
262
+ "description": "Select the operatiing mode for Heat, if this mode is not supported, it will be disabled.",
263
263
  "required": true
264
264
  },
265
265
  "ataCoolDryFanMode": {
@@ -294,7 +294,7 @@
294
294
  ]
295
295
  }
296
296
  ],
297
- "description": "Select operation mode for Cool, if selected mode is not supported then will be disabled.",
297
+ "description": "Select the operatiing mode for Cool, if this mode is not supported, it will be disabled.",
298
298
  "required": true
299
299
  },
300
300
  "ataAutoDryFanMode": {
@@ -329,7 +329,7 @@
329
329
  ]
330
330
  }
331
331
  ],
332
- "description": "Select operation mode for Auto, if mode is not supported then will be disabled.",
332
+ "description": "Select the operatiing mode for Auto, if this mode is not supported, it will be disabled.",
333
333
  "required": true
334
334
  },
335
335
  "ataPresets": {
package/index.js CHANGED
@@ -17,12 +17,6 @@ class MelCloudPlatform {
17
17
  this.accessories = [];
18
18
  const accountsName = [];
19
19
 
20
- //check if the directory exists, if not then create it
21
- const prefDir = path.join(api.user.storagePath(), 'melcloud');
22
- if (!fs.existsSync(prefDir)) {
23
- fs.mkdirSync(prefDir);
24
- };
25
-
26
20
  api.on('didFinishLaunching', () => {
27
21
  //loop through accounts
28
22
  for (const account of config.accounts) {
@@ -64,9 +58,21 @@ class MelCloudPlatform {
64
58
  };
65
59
  const debug1 = enableDebugMode ? log.info(`Account: ${accountName}, Config: ${JSON.stringify(debugData, null, 2)}`) : false;
66
60
 
67
- //set refresh interval
61
+ //define directory and file paths
62
+ const prefDir = path.join(api.user.storagePath(), 'melcloud');
68
63
  const accountInfoFile = `${prefDir}/${accountName}_Account`;
69
64
  const buildingsFile = `${prefDir}/${accountName}_Buildings`;
65
+
66
+ //create directory if it doesn't exist
67
+ try {
68
+ //create directory if it doesn't exist
69
+ fs.mkdirSync(prefDir, { recursive: true });
70
+ } catch (error) {
71
+ log.error(`Account: ${accountName}, prepare directory error: ${error.message ?? error}`);
72
+ return;
73
+ }
74
+
75
+ //set refresh interval
70
76
  const refreshInterval = account.refreshInterval * 1000 || 120000;
71
77
  const deviceRefreshInterval = account.deviceRefreshInterval * 1000 || 5000;
72
78
 
@@ -210,23 +216,5 @@ class MelCloudPlatform {
210
216
  };
211
217
 
212
218
  module.exports = (api) => {
213
- const { Service, Characteristic, Units, Formats, Perms } = api.hap;
214
- //custom characteristics
215
- class CustomTargetHeaterCoolerState extends Characteristic {
216
- constructor() {
217
- super('Target Mode', '000000B2-0000-1000-8000-0026BB765291');
218
- this.setProps({
219
- format: Formats.UINT8,
220
- minValue: 1,
221
- maxValue: 2,
222
- minStep: 1,
223
- validValues: [1, 2],
224
- perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE]
225
- });
226
- this.value = this.getDefaultValue();
227
- }
228
- }
229
- Characteristic.CustomTargetHeaterCoolerState = CustomTargetHeaterCoolerState;
230
-
231
219
  api.registerPlatform(CONSTANTS.PluginName, CONSTANTS.PlatformName, MelCloudPlatform, true);
232
220
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "2.3.0-beta.30",
4
+ "version": "2.3.0-beta.32",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",