forked from platypush/platypush
Support sensor value reported both on value
as well as _value
fields.
This commit is contained in:
parent
bfc87e0f7b
commit
486f37a45e
1 changed files with 10 additions and 2 deletions
|
@ -13,8 +13,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-s-3 col-m-2 pull-right"
|
<div class="col-s-3 col-m-2 pull-right"
|
||||||
v-if="value.value != null">
|
v-if="computedValue != null">
|
||||||
<span class="value" v-text="value.value" />
|
<span class="value" v-text="computedValue" />
|
||||||
<span class="unit" v-text="value.unit"
|
<span class="unit" v-text="value.unit"
|
||||||
v-if="value.unit != null" />
|
v-if="value.unit != null" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,6 +30,14 @@ export default {
|
||||||
name: 'Sensor',
|
name: 'Sensor',
|
||||||
components: {EntityIcon},
|
components: {EntityIcon},
|
||||||
mixins: [EntityMixin],
|
mixins: [EntityMixin],
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
computedValue() {
|
||||||
|
if (this.value.value != null)
|
||||||
|
return this.value.value
|
||||||
|
return this.value._value
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue