forked from platypush/platypush
Explicitly pass the new value on the Z-Wave setValue handler in case of binary toggles, since the target element can't be reliably determined
This commit is contained in:
parent
7f157d0234
commit
ce0ca2e9ee
9 changed files with 15 additions and 12 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
platypush/backend/http/webapp/dist/static/js/chunk-005e4e12.28454713.js
vendored
Normal file
2
platypush/backend/http/webapp/dist/static/js/chunk-005e4e12.28454713.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
platypush/backend/http/webapp/dist/static/js/chunk-005e4e12.28454713.js.map
vendored
Normal file
1
platypush/backend/http/webapp/dist/static/js/chunk-005e4e12.28454713.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -55,7 +55,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="boolean" v-else-if="['Bool', 'Button'].indexOf(value.type) >= 0">
|
<div class="boolean" v-else-if="['Bool', 'Button'].indexOf(value.type) >= 0">
|
||||||
<ToggleSwitch :value="value.data" @input="onValueChange" />
|
<ToggleSwitch :value="value.data" @input="onValueChange($event, !value.data)" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="value-data" v-else>
|
<div class="value-data" v-else>
|
||||||
|
@ -194,10 +194,13 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
async onValueChange(event) {
|
async onValueChange(event, data) {
|
||||||
const target = event.target ? event.target : event.event.target.parentElement
|
const target = event.target ? event.target : event.event.target.parentElement
|
||||||
const value = this.node.values[this.value.id_on_network]
|
const value = this.node.values[this.value.id_on_network]
|
||||||
let data = target.value != null ? target.value : event.value
|
|
||||||
|
if (data === undefined)
|
||||||
|
data = target.value != null ? target.value : event.value
|
||||||
|
|
||||||
switch (value.type) {
|
switch (value.type) {
|
||||||
case 'List':
|
case 'List':
|
||||||
data = value.data_items[event.target.value]
|
data = value.data_items[event.target.value]
|
||||||
|
@ -212,7 +215,7 @@ export default {
|
||||||
|
|
||||||
case 'Button':
|
case 'Button':
|
||||||
case 'Bool':
|
case 'Bool':
|
||||||
data = !parseInt(data)
|
data = !!parseInt(data)
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'Decimal':
|
case 'Decimal':
|
||||||
|
|
Loading…
Reference in a new issue