This commit is contained in:
Koen Kanters 2021-07-01 19:59:52 +02:00
parent 234e39eaea
commit 1985e24517

View File

@ -235,13 +235,11 @@ class EntityPublish extends Extension {
const msg = result.state; const msg = result.state;
if (endpointName) { if (endpointName) {
for (const key of ['state', 'brightness', 'color', 'color_temp', 'color_mode']) { for (const key of Object.keys(msg)) {
if (msg.hasOwnProperty(key)) {
msg[`${key}_${endpointName}`] = msg[key]; msg[`${key}_${endpointName}`] = msg[key];
delete msg[key]; delete msg[key];
} }
} }
}
// filter out attribute listed in filtered_optimistic // filter out attribute listed in filtered_optimistic
if (options.hasOwnProperty('filtered_optimistic')) { if (options.hasOwnProperty('filtered_optimistic')) {