@homebridge-plugins/homebridge-eufy-security 5.0.0-beta.30 → 5.0.0-beta.31
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.
|
@@ -794,7 +794,10 @@ function configSignature(config) {
|
|
|
794
794
|
async function updateConfig(block) {
|
|
795
795
|
const nextConfig = pluginConfig.map((candidate) => (candidate.platform === 'HomebridgeEufy' ? block : candidate));
|
|
796
796
|
if (!nextConfig.includes(block)) nextConfig.push(block);
|
|
797
|
-
|
|
797
|
+
// Homebridge UI merges each block into the one it holds, so a key the block dropped is sent as undefined to clear it.
|
|
798
|
+
const cleared = Object.keys(configuredBlock() ?? {}).filter((key) => !(key in block));
|
|
799
|
+
const sent = { ...Object.fromEntries(cleared.map((key) => [key, undefined])), ...block };
|
|
800
|
+
await homebridge.updatePluginConfig(nextConfig.map((candidate) => (candidate === block ? sent : candidate)));
|
|
798
801
|
pluginConfig = nextConfig;
|
|
799
802
|
if (configSignature(nextConfig) === savedConfigSignature) homebridge.disableSaveButton();
|
|
800
803
|
else homebridge.enableSaveButton();
|
package/package.json
CHANGED