mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Climate RTL fixes (#3002)
This commit is contained in:
parent
702c17d658
commit
3b8f8f8189
@ -25,6 +25,7 @@ class HaClimateControl extends EventsMixin(PolymerElement) {
|
|||||||
#target_temperature {
|
#target_temperature {
|
||||||
@apply --layout-self-center;
|
@apply --layout-self-center;
|
||||||
font-size: 200%;
|
font-size: 200%;
|
||||||
|
direction: ltr;
|
||||||
}
|
}
|
||||||
.control-buttons {
|
.control-buttons {
|
||||||
font-size: 200%;
|
font-size: 200%;
|
||||||
|
@ -29,18 +29,24 @@ class HaClimateState extends LocalizeMixin(PolymerElement) {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.unit {
|
||||||
|
display: inline-block;
|
||||||
|
direction: ltr;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="target">
|
<div class="target">
|
||||||
<template is="dom-if" if="[[_hasKnownState(stateObj.state)]]">
|
<template is="dom-if" if="[[_hasKnownState(stateObj.state)]]">
|
||||||
<span class="state-label"> [[_localizeState(stateObj.state)]] </span>
|
<span class="state-label"> [[_localizeState(stateObj.state)]] </span>
|
||||||
</template>
|
</template>
|
||||||
[[computeTarget(hass, stateObj)]]
|
<div class="unit">[[computeTarget(hass, stateObj)]]</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template is="dom-if" if="[[currentStatus]]">
|
<template is="dom-if" if="[[currentStatus]]">
|
||||||
<div class="current">
|
<div class="current">
|
||||||
[[localize('ui.card.climate.currently')]]: [[currentStatus]]
|
[[localize('ui.card.climate.currently')]]:
|
||||||
|
<div class="unit">[[currentStatus]]</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
`;
|
`;
|
||||||
|
@ -17,6 +17,7 @@ import { supportsFeature } from "../../../common/entity/supports-feature";
|
|||||||
|
|
||||||
import EventsMixin from "../../../mixins/events-mixin";
|
import EventsMixin from "../../../mixins/events-mixin";
|
||||||
import LocalizeMixin from "../../../mixins/localize-mixin";
|
import LocalizeMixin from "../../../mixins/localize-mixin";
|
||||||
|
import { computeRTLDirection } from "../../../common/util/compute_rtl";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @appliesMixin EventsMixin
|
* @appliesMixin EventsMixin
|
||||||
@ -84,6 +85,7 @@ class MoreInfoClimate extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
width: 90px;
|
width: 90px;
|
||||||
font-size: 200%;
|
font-size: 200%;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
direction: ltr;
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-climate-control.range-control-left,
|
ha-climate-control.range-control-left,
|
||||||
@ -181,6 +183,7 @@ class MoreInfoClimate extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
value="[[stateObj.attributes.humidity]]"
|
value="[[stateObj.attributes.humidity]]"
|
||||||
on-change="targetHumiditySliderChanged"
|
on-change="targetHumiditySliderChanged"
|
||||||
ignore-bar-touch=""
|
ignore-bar-touch=""
|
||||||
|
dir="[[rtl]]"
|
||||||
>
|
>
|
||||||
</ha-paper-slider>
|
</ha-paper-slider>
|
||||||
</div>
|
</div>
|
||||||
@ -314,6 +317,12 @@ class MoreInfoClimate extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
awayToggleChecked: Boolean,
|
awayToggleChecked: Boolean,
|
||||||
auxToggleChecked: Boolean,
|
auxToggleChecked: Boolean,
|
||||||
onToggleChecked: Boolean,
|
onToggleChecked: Boolean,
|
||||||
|
|
||||||
|
rtl: {
|
||||||
|
type: String,
|
||||||
|
value: "ltr",
|
||||||
|
computed: "_computeRTLDirection(hass)",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -557,6 +566,10 @@ class MoreInfoClimate extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
_localizeFanMode(localize, mode) {
|
_localizeFanMode(localize, mode) {
|
||||||
return localize(`state_attributes.climate.fan_mode.${mode}`) || mode;
|
return localize(`state_attributes.climate.fan_mode.${mode}`) || mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_computeRTLDirection(hass) {
|
||||||
|
return computeRTLDirection(hass);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define("more-info-climate", MoreInfoClimate);
|
customElements.define("more-info-climate", MoreInfoClimate);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user