Invert whitelist logic in deviceAutomationsEqual (#6032)

This commit is contained in:
Robert Chmielowiec 2020-05-28 16:24:22 +02:00 committed by GitHub
parent 49b1e5897e
commit f354e1eb0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,14 +65,15 @@ export const fetchDeviceTriggerCapabilities = (
trigger,
});
const whitelist = [
"above",
"below",
"brightness_pct",
"code",
"for",
"position",
"set_brightness",
const deviceAutomationIdentifiers = [
"device_id",
"domain",
"entity_id",
"type",
"subtype",
"event",
"condition",
"platform",
];
export const deviceAutomationsEqual = (
@ -84,7 +85,7 @@ export const deviceAutomationsEqual = (
}
for (const property in a) {
if (whitelist.includes(property)) {
if (!deviceAutomationIdentifiers.includes(property)) {
continue;
}
if (!Object.is(a[property], b[property])) {
@ -92,7 +93,7 @@ export const deviceAutomationsEqual = (
}
}
for (const property in b) {
if (whitelist.includes(property)) {
if (!deviceAutomationIdentifiers.includes(property)) {
continue;
}
if (!Object.is(a[property], b[property])) {