mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-20 15:56:35 +00:00
Invert whitelist logic in deviceAutomationsEqual (#6032)
This commit is contained in:
parent
49b1e5897e
commit
f354e1eb0f
@ -65,14 +65,15 @@ export const fetchDeviceTriggerCapabilities = (
|
|||||||
trigger,
|
trigger,
|
||||||
});
|
});
|
||||||
|
|
||||||
const whitelist = [
|
const deviceAutomationIdentifiers = [
|
||||||
"above",
|
"device_id",
|
||||||
"below",
|
"domain",
|
||||||
"brightness_pct",
|
"entity_id",
|
||||||
"code",
|
"type",
|
||||||
"for",
|
"subtype",
|
||||||
"position",
|
"event",
|
||||||
"set_brightness",
|
"condition",
|
||||||
|
"platform",
|
||||||
];
|
];
|
||||||
|
|
||||||
export const deviceAutomationsEqual = (
|
export const deviceAutomationsEqual = (
|
||||||
@ -84,7 +85,7 @@ export const deviceAutomationsEqual = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const property in a) {
|
for (const property in a) {
|
||||||
if (whitelist.includes(property)) {
|
if (!deviceAutomationIdentifiers.includes(property)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!Object.is(a[property], b[property])) {
|
if (!Object.is(a[property], b[property])) {
|
||||||
@ -92,7 +93,7 @@ export const deviceAutomationsEqual = (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const property in b) {
|
for (const property in b) {
|
||||||
if (whitelist.includes(property)) {
|
if (!deviceAutomationIdentifiers.includes(property)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!Object.is(a[property], b[property])) {
|
if (!Object.is(a[property], b[property])) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user