@lv426/homebridge-systemair-enhanced 1.0.5 → 1.0.6

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 (2) hide show
  1. package/index.js +22 -36
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -26,51 +26,37 @@ class SystemairVentilator {
26
26
  TARGET_TEMP: '2000', // Target temperature setting
27
27
  HUMIDITY: '12135', // Current humidity sensor reading
28
28
  ECO_MODE: '2504', // Turning ECO mode on / off
29
- FREE_COOLING: '4100', // Free Cooling activate / deactivate
29
+ FREE_COOLING: '4100', // Free Cooling activate / deactiva
30
30
  };
31
31
 
32
32
  this.axiosInstance = axios.create({
33
33
  timeout: 20000, // 20 seconds timeout
34
34
  });
35
35
 
36
- // FAN
37
- this.fanService =
38
- this.accessory.getService(Service.Fanv2) ??
39
- this.accessory.addService(Service.Fanv2, `${this.config.name} Fan`);
40
-
41
- // REFRESH (Switch #1) — add subtype "refresh"
42
- this.refreshService =
43
- this.accessory.getServiceById(Service.Switch, 'refresh') ??
44
- this.accessory.addService(
45
- Service.Switch,
46
- `${this.config.name} Refresh`,
47
- 'refresh'
48
- );
36
+ // Fan service
37
+ this.fanService = new Service.Fanv2(this.config.name + ' Fan');
49
38
 
50
- // ECO MODE (Switch #2) — add subtype "eco"
51
- this.ecoModeService =
52
- this.accessory.getServiceById(Service.Switch, 'eco') ??
53
- this.accessory.addService(
54
- Service.Switch,
55
- `${this.config.name} Eco Mode`,
56
- 'eco'
57
- );
39
+ // Refresh service (with subtype for uniqueness)
40
+ this.refreshService = new Service.Switch(
41
+ this.config.name + ' Refresh',
42
+ 'refresh'
43
+ );
58
44
 
59
- // THERMOSTAT
60
- this.thermostatService =
61
- this.accessory.getService(Service.Thermostat) ??
62
- this.accessory.addService(
63
- Service.Thermostat,
64
- `${this.config.name} Thermostat`
65
- );
45
+ // Eco Mode service (with subtype for uniqueness)
46
+ this.ecoModeService = new Service.Switch(
47
+ this.config.name + ' Eco Mode',
48
+ 'eco'
49
+ );
66
50
 
67
- // HUMIDITY SENSOR
68
- this.humiditySensorService =
69
- this.accessory.getService(Service.HumiditySensor) ??
70
- this.accessory.addService(
71
- Service.HumiditySensor,
72
- `${this.config.name} Humidity`
73
- );
51
+ // Thermostat service
52
+ this.thermostatService = new Service.Thermostat(
53
+ this.config.name + ' Thermostat'
54
+ );
55
+
56
+ // Humidity sensor service
57
+ this.humiditySensorService = new Service.HumiditySensor(
58
+ this.config.name + ' Humidity'
59
+ );
74
60
 
75
61
  this.setupCharacteristics();
76
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv426/homebridge-systemair-enhanced",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "An enhanced Homebridge plugin for controlling Systemair Ventilators.",
5
5
  "main": "index.js",
6
6
  "scripts": {