home-assistant-js-websocket
Advanced tools
Comparing version 6.1.0 to 6.1.1
@@ -38,2 +38,5 @@ import { getCollection } from "./collection.js"; | ||
const { "+": toAdd, "-": toRemove } = updates.c[entityId]; | ||
const attributesChanged = (toAdd === null || toAdd === void 0 ? void 0 : toAdd.a) || (toRemove === null || toRemove === void 0 ? void 0 : toRemove.a); | ||
const attributes = attributesChanged | ||
? Object.assign({}, entityState.attributes) : entityState.attributes; | ||
if (toAdd) { | ||
@@ -58,10 +61,11 @@ if (toAdd.s) { | ||
if (toAdd.a) { | ||
entityState.attributes = Object.assign(Object.assign({}, entityState.attributes), toAdd.a); | ||
Object.assign(attributes, toAdd.a); | ||
} | ||
} | ||
if (toRemove) { | ||
const attributes = Object.assign({}, entityState.attributes); | ||
for (const key in toRemove.a) { | ||
if (toRemove === null || toRemove === void 0 ? void 0 : toRemove.a) { | ||
for (const key of toRemove.a) { | ||
delete attributes[key]; | ||
} | ||
} | ||
if (attributesChanged) { | ||
entityState.attributes = attributes; | ||
@@ -68,0 +72,0 @@ } |
@@ -932,2 +932,5 @@ (function (global, factory) { | ||
const { "+": toAdd, "-": toRemove } = updates.c[entityId]; | ||
const attributesChanged = (toAdd === null || toAdd === void 0 ? void 0 : toAdd.a) || (toRemove === null || toRemove === void 0 ? void 0 : toRemove.a); | ||
const attributes = attributesChanged | ||
? Object.assign({}, entityState.attributes) : entityState.attributes; | ||
if (toAdd) { | ||
@@ -952,10 +955,11 @@ if (toAdd.s) { | ||
if (toAdd.a) { | ||
entityState.attributes = Object.assign(Object.assign({}, entityState.attributes), toAdd.a); | ||
Object.assign(attributes, toAdd.a); | ||
} | ||
} | ||
if (toRemove) { | ||
const attributes = Object.assign({}, entityState.attributes); | ||
for (const key in toRemove.a) { | ||
if (toRemove === null || toRemove === void 0 ? void 0 : toRemove.a) { | ||
for (const key of toRemove.a) { | ||
delete attributes[key]; | ||
} | ||
} | ||
if (attributesChanged) { | ||
entityState.attributes = attributes; | ||
@@ -962,0 +966,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"sideEffects": false, | ||
"version": "6.1.0", | ||
"version": "6.1.1", | ||
"description": "Home Assistant websocket client", | ||
@@ -8,0 +8,0 @@ "source": "lib/index.ts", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
166974
3464