Add the unit to the Dimmer display value if it's available

This commit is contained in:
Fabio Manganiello 2023-02-04 17:28:54 +01:00
parent 0311d87bc3
commit db5846d296
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -8,11 +8,11 @@
:error="error" /> :error="error" />
</div> </div>
<div class="col-s-8 col-m-9 label"> <div class="col-s-7 col-m-8 label">
<div class="name" v-text="value.name" /> <div class="name" v-text="value.name" />
</div> </div>
<div class="col-s-3 col-m-2 buttons pull-right"> <div class="col-s-4 col-m-3 buttons pull-right">
<button @click.stop="collapsed = !collapsed"> <button @click.stop="collapsed = !collapsed">
<i class="fas" <i class="fas"
:class="{'fa-angle-up': !collapsed, 'fa-angle-down': collapsed}" /> :class="{'fa-angle-up': !collapsed, 'fa-angle-down': collapsed}" />
@ -59,7 +59,10 @@ export default {
if (this.value?.is_write_only || this.value?.value == null) if (this.value?.is_write_only || this.value?.value == null)
return null return null
return this.value.value let value = this.value.value
if (this.value.unit)
value = `${value} ${this.value.unit}`
return value
} }
}, },
@ -102,6 +105,7 @@ export default {
.value-percent { .value-percent {
font-size: 1.1em; font-size: 1.1em;
font-weight: bold; font-weight: bold;
direction: ltr;
opacity: 0.7; opacity: 0.7;
} }
} }