Skip to content

Commit

Permalink
Fixes logic to detect when a thing's config changes vs the whole thin…
Browse files Browse the repository at this point in the history
…g structure (openhab#2729)

Fixes openhab#2704

---------

Signed-off-by: Dan Cunningham <[email protected]>
  • Loading branch information
digitaldan authored Aug 25, 2024
1 parent 6139039 commit 77dbfcb
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,17 @@ export default {
// create rule object clone in order to be able to delete status part
// which can change from eventsource but doesn't mean a rule modification
let thingClone = cloneDeep(this.thing)
delete thingClone.statusInfo
delete this.savedThing.statusInfo
let savedThingClone = cloneDeep(this.savedThing)
// check if the configuration has changed between the thing and the original/saved version
this.configDirty = !fastDeepEqual(thingClone.configuration, savedThingClone.configuration)
this.configDirty = !fastDeepEqual(thingClone.configuration, this.savedThing.configuration)
this.thingDirty = !fastDeepEqual(thingClone, this.savedThing)
// check if the rest of the thing has changed between the thing and the original/saved version
delete thingClone.statusInfo
delete thingClone.configuration
delete savedThingClone.statusInfo
delete savedThingClone.configuration
this.thingDirty = !fastDeepEqual(thingClone, savedThingClone)
}
},
deep: true
Expand Down

0 comments on commit 77dbfcb

Please sign in to comment.