homebridge-myplace 2.3.0 → 2.3.2

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
@@ -1,7 +1,3 @@
1
1
  ### Homebridge-myplace - An independent plugin for Homebridge bringing Advantage Air MyPlace system, its smaller siblings (E-zone, MyAir, MyAir4, etc) and its cousins (e.g. Fujitsu AnywAir) to Homekit
2
- ##### v2.3.0 (2025-10-02)
3
-
4
- ###### (1) Automatic device discovery: AdvantageAir devices can now be auto-discovered if no IP is specified, or if the configured IP is invalid or inaccessible.
5
- ###### (2) Smart fan detection: Any lighting switch with a name ending in " Fan" or " Ex", or starting with "Fan " or "Ex ", will now be treated as a fan accessory.
6
- ###### (3) Accessory limit option: Added an optional parameter to cap the number of accessories created by this plugin (Homebridge supports a maximum of 149 accessories per bridge).
7
- ###### (4) Stability improvements: Bug fixes and under-the-hood enhancements for improved reliability and robustness.
2
+ ##### v2.3.2 (15-11-2025)
3
+ ##### (1) Enhancement: Added fallback to cached configuration when no devices is accessible on the local network.
package/Cmd5Platform.js CHANGED
@@ -4,6 +4,7 @@
4
4
  const { getAccessoryName,
5
5
  getAccessoryDisplayName } = require( "./utils/getAccessoryNameFunctions" );
6
6
  const { parseAddQueueTypes } = require( "./Cmd5PriorityPollingQueue" );
7
+ const { writeConfig } = require( "./utils/writeConfig" );
7
8
  const { removeTempDir } = require( "./utils/removeTempDir" );
8
9
  const { updateConfig } = require( "./utils/updateConfig" );
9
10
 
@@ -75,6 +76,7 @@ class Cmd5Platform
75
76
  this.config = config;
76
77
  this.api = api;
77
78
  this.Service = this.api.hap.Service;
79
+ this.storagePath = this.api.user.storagePath();
78
80
 
79
81
  // Pass along the trigger when creating the Cmd5Accessory.
80
82
  // Note: The LEVEL starts at -1 as the first one gets incremented to Zero.
@@ -110,7 +112,10 @@ class Cmd5Platform
110
112
 
111
113
  // Update the config
112
114
  // The original config has no config for accessories and that needs to be generated by createMyplaceConfig.js
113
- this.config = await updateConfig( this.config, this.log, __dirname );
115
+ this.config = await updateConfig( this.config, this.log, this.storagePath, __dirname );
116
+
117
+ // Write the this.config to ~/.myplace/config.json, it may be useful in power failure situation
118
+ writeConfig( this.config, this.storagePath, this.log );
114
119
 
115
120
  // Now process this updated config
116
121
  this.parseConfigForCmd5Directives( this.config );
@@ -120,10 +120,10 @@ class Cmd5PriorityPollingQueue
120
120
  if ( this.state_cmd.match( /MyPlace.sh'$/ ) )
121
121
  {
122
122
  // Reject Set requests to change Fanv2 rotationSpeed or to turn off myZone for zones with temperature sensors
123
- if ( this.typeIndex == 20 && this.displayName.match ( / Zone$/ ) &&
124
- ( characteristicString == 'RotationSpeed' ||
125
- ( characteristicString == 'RotationDirection' && value == 1 )
126
- )
123
+ if ( this.typeIndex == 20 && this.displayName.match ( / Zone$/ ) &&
124
+ ( characteristicString == 'RotationSpeed' ||
125
+ ( characteristicString == 'RotationDirection' && value == 1 )
126
+ )
127
127
  )
128
128
  {
129
129
  let storedValue = this.cmd5Storage.getStoredValueForIndex( accTypeEnumIndex );
@@ -132,8 +132,8 @@ class Cmd5PriorityPollingQueue
132
132
  return;
133
133
  }
134
134
  // Reject Set requests to change Thermostat targetHeatingCoolingState for Zone Thermostat
135
- if ( this.typeIndex == 57 && this.displayName.match ( / Thermostat$/ ) &&
136
- characteristicString == 'TargetHeatingCoolingState'
135
+ if ( this.typeIndex == 57 && this.displayName.match ( / Thermostat$/ ) &&
136
+ characteristicString == 'TargetHeatingCoolingState'
137
137
  )
138
138
  {
139
139
  let storedValue = this.cmd5Storage.getStoredValueForIndex( accTypeEnumIndex );
@@ -143,13 +143,13 @@ class Cmd5PriorityPollingQueue
143
143
  }
144
144
  // Turn on the Zone when this Zone is set as myZone
145
145
  else if ( this.typeIndex == 20 && this.displayName.match ( / Zone$/ ) &&
146
- characteristicString == 'RotationDirection' && value == 0
146
+ characteristicString == 'RotationDirection' && value == 0
147
147
  )
148
148
  {
149
149
  this.service.getCharacteristic( 'Active' ).updateValue( 1 );
150
150
  }
151
151
  else if ( this.displayName.match( / FanSpeed$/ ) )
152
- {
152
+ {
153
153
  // Abort if 'on' or 'rotationSpeed' value = 0, this accessory is always on
154
154
  if ( value == 0 )
155
155
  {