Skip to content

Commit

Permalink
release 3.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 committed Aug 31, 2024
1 parent e3e0973 commit 7d9dec4
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 31 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- do not configure it manually, always using Config UI X
- required Homebridge v2.0.0 and above

## [3.1.2] - (31.08.2024)

## Changes

- fix presets configured array

## [3.1.0] - (31.08.2024)

## Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "MELCloud Control",
"name": "homebridge-melcloud-control",
"version": "3.1.1",
"version": "3.1.2",
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
"license": "MIT",
"author": "grzegorz914",
Expand Down
11 changes: 5 additions & 6 deletions src/deviceata.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class DeviceAta extends EventEmitter {
this.displayMode = device.displayMode;
this.temperatureSensor = device.temperatureSensor || false;
this.temperatureSensorOutdoor = device.temperatureSensorOutdoor || false;
this.presetsEnabled = device.presets || false;
this.heatDryFanMode = device.heatDryFanMode || 1; //NONE, HEAT, DRY, FAN
this.coolDryFanMode = device.coolDryFanMode || 1; //NONE, COOL, DRY, FAN
this.autoDryFanMode = device.autoDryFanMode || 1; //NONE, AUTO, DRY, FAN
Expand All @@ -46,13 +45,13 @@ class DeviceAta extends EventEmitter {
const presetDisplayType = preset.displayType ?? 0;
const presetNamePrefix = preset.namePrefix ?? false;
if (presetName && presetDisplayType > 0) {
const buttonServiceType = ['', Service.Outlet, Service.Switch, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][presetDisplayType];
const buttonCharacteristicType = ['', Characteristic.On, Characteristic.On, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][presetDisplayType];
const presetyServiceType = ['', Service.Outlet, Service.Switch, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][presetDisplayType];
const presetCharacteristicType = ['', Characteristic.On, Characteristic.On, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][presetDisplayType];
preset.namePrefix = presetNamePrefix;
preset.serviceType = buttonServiceType;
preset.characteristicType = buttonCharacteristicType;
preset.serviceType = presetyServiceType;
preset.characteristicType = presetCharacteristicType;
preset.state = false;
this.buttonsConfigured.push(preset);
this.presetsConfigured.push(preset);
} else {
const log = presetDisplayType === 0 ? false : this.emit('message', `Preset Name: ${preset ? preset : 'Missing'}.`);
};
Expand Down
38 changes: 19 additions & 19 deletions src/deviceatw.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,25 @@ class DeviceAtw extends EventEmitter {
//function
this.melCloud = melCloud; //function

//presets configured
this.presetsConfigured = [];
for (const preset of this.presets) {
const presetName = preset.name ?? false;
const presetDisplayType = preset.displayType ?? 0;
const presetNamePrefix = preset.namePrefix ?? false;
if (presetName && presetDisplayType > 0) {
const buttonServiceType = ['', Service.Outlet, Service.Switch, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][presetDisplayType];
const buttonCharacteristicType = ['', Characteristic.On, Characteristic.On, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][presetDisplayType];
preset.namePrefix = presetNamePrefix;
preset.serviceType = buttonServiceType;
preset.characteristicType = buttonCharacteristicType;
preset.state = false;
this.buttonsConfigured.push(preset);
} else {
const log = presetDisplayType === 0 ? false : this.emit('message', `Preset Name: ${preset ? preset : 'Missing'}.`);
};
}
this.presetsConfiguredCount = this.presetsConfigured.length || 0;
//presets configured
this.presetsConfigured = [];
for (const preset of this.presets) {
const presetName = preset.name ?? false;
const presetDisplayType = preset.displayType ?? 0;
const presetNamePrefix = preset.namePrefix ?? false;
if (presetName && presetDisplayType > 0) {
const presetyServiceType = ['', Service.Outlet, Service.Switch, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][presetDisplayType];
const presetCharacteristicType = ['', Characteristic.On, Characteristic.On, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][presetDisplayType];
preset.namePrefix = presetNamePrefix;
preset.serviceType = presetyServiceType;
preset.characteristicType = presetCharacteristicType;
preset.state = false;
this.presetsConfigured.push(preset);
} else {
const log = presetDisplayType === 0 ? false : this.emit('message', `Preset Name: ${preset ? preset : 'Missing'}.`);
};
}
this.presetsConfiguredCount = this.presetsConfigured.length || 0;

//buttons configured
this.buttonsConfigured = [];
Expand Down
10 changes: 5 additions & 5 deletions src/deviceerv.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ class DeviceErv extends EventEmitter {
const presetDisplayType = preset.displayType ?? 0;
const presetNamePrefix = preset.namePrefix ?? false;
if (presetName && presetDisplayType > 0) {
const buttonServiceType = ['', Service.Outlet, Service.Switch, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][presetDisplayType];
const buttonCharacteristicType = ['', Characteristic.On, Characteristic.On, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][presetDisplayType];
const presetyServiceType = ['', Service.Outlet, Service.Switch, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][presetDisplayType];
const presetCharacteristicType = ['', Characteristic.On, Characteristic.On, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][presetDisplayType];
preset.namePrefix = presetNamePrefix;
preset.serviceType = buttonServiceType;
preset.characteristicType = buttonCharacteristicType;
preset.serviceType = presetyServiceType;
preset.characteristicType = presetCharacteristicType;
preset.state = false;
this.buttonsConfigured.push(preset);
this.presetsConfigured.push(preset);
} else {
const log = presetDisplayType === 0 ? false : this.emit('message', `Preset Name: ${preset ? preset : 'Missing'}.`);
};
Expand Down

0 comments on commit 7d9dec4

Please sign in to comment.