Thing details: Fix config action saves the whole Thing (#2775)

A Thing config action is only supposed to save the config of the Thing,
not the whole Thing.

Fixes https://github.com/openhab/openhab-core/issues/4380.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
pull/2780/head
Florian Hotze 2024-10-01 11:19:48 +02:00 committed by GitHub
parent bdb54a54c7
commit d78e6d9470
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 4 deletions

View File

@ -547,8 +547,6 @@ export default {
})
},
doConfigAction (action) {
let thing = this.thing
let save = this.save
if (action.type !== 'BOOLEAN') {
console.warn('Invalid action type', action)
return
@ -564,8 +562,15 @@ export default {
prompt,
this.thing.label,
() => {
thing.configuration[action.name] = true
save()
const name = action.name
// Make sure Vue reactivity notices the change
this.$set(this.thing, 'configuration', ({
name: true,
...this.thing.configuration
}))
// Vue reactivity is too slow to recognize config change before the API call, manually mark the config dirty
this.configDirty = true
this.save()
}
)
},