homebridge-melcloud-control 2.5.0-beta.19 → 2.5.0-beta.20

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.
@@ -6,7 +6,7 @@
6
6
  <div id="melCloudAccount" style="display: none;" class="card card-body">
7
7
  <form id="configForm">
8
8
  <div class="text-center">
9
- <label id="accountName" style="font-size: 23px">Account Name</label><br>
9
+ <label id="accountName" style="font-size: 23px">Account</label><br>
10
10
  <label id="info" style="text-align: center; font-size: 17px;">MELCloud</label><br><br>
11
11
  </div>
12
12
  <div class="form-group">
@@ -63,7 +63,7 @@
63
63
  document.getElementById('language').value = pluginConfig[0].accounts[i].language || '';
64
64
 
65
65
  const accountConfigured = pluginConfig[0].accounts[i].name && pluginConfig[0].accounts[i].user && pluginConfig[0].accounts[i].passwd && pluginConfig[0].accounts[i].language;
66
- const setButtonName = accountConfigured ? document.getElementById('logIn').removeAttribute('disabled') : document.getElementById('logIn').setAttribute('disabled');
66
+ const setButtonState = accountConfigured ? document.getElementById('logIn').removeAttribute('disabled') : document.getElementById('logIn').setAttribute('disabled');
67
67
  await homebridge.updatePluginConfig(pluginConfig);
68
68
  this.deviceIndex = i;
69
69
  });
@@ -82,7 +82,7 @@
82
82
  pluginConfig[0].accounts[this.deviceIndex].language = document.querySelector('#language').value;
83
83
 
84
84
  const accountConfigured = pluginConfig[0].accounts[i].name && pluginConfig[0].accounts[i].user && pluginConfig[0].accounts[i].passwd && pluginConfig[0].accounts[i].language;
85
- const setButtonMode = accountConfigured ? document.getElementById('logIn').removeAttribute('disabled') : document.getElementById('logIn').setAttribute('disabled');
85
+ const setButtonState = accountConfigured ? document.getElementById('logIn').removeAttribute('disabled') : document.getElementById('logIn').setAttribute('disabled');
86
86
 
87
87
  await homebridge.updatePluginConfig(pluginConfig);
88
88
  await homebridge.savePluginConfig(pluginConfig);
@@ -118,7 +118,6 @@
118
118
  refreshInterval: refreshInterval
119
119
  };
120
120
  const response = await homebridge.request('/connect', payload);
121
- homebridge.toast.info(`Response: ${JSON.stringify(response, null, 2)}`);
122
121
  const info = response.info ?? '';
123
122
  const status = response.status;
124
123
  const devices = response.data ?? [];
@@ -131,7 +130,8 @@
131
130
  const deviceName = deviceInfo.DeviceName;
132
131
  };
133
132
 
134
- document.getElementById('info').innerHTML = `${info} Found: ${devices.length} devices. Now You can start to configure it.`;
133
+ const devicesCount = devices.length;
134
+ document.getElementById('info').innerHTML = `${info}, found ${devicesCount} ${devicesCount !== 1 ? 'devices' : 'device'}. Now You can start to configure it.`;
135
135
  document.getElementById('info').style.color = 'green';
136
136
  await homebridge.updatePluginConfig(pluginConfig);
137
137
  await homebridge.savePluginConfig(pluginConfig);
@@ -31,7 +31,7 @@ class PluginUiServer extends HomebridgePluginUiServer {
31
31
  const contextKey = await melCloud.connect();
32
32
  const devices = await melCloud.chackDevicesList(contextKey);
33
33
  return data = {
34
- info: 'Check devices list complete.',
34
+ info: 'Success!',
35
35
  status: 0,
36
36
  data: devices
37
37
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "2.5.0-beta.19",
4
+ "version": "2.5.0-beta.20",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",