Removed humidifier row and a space in front of percent

This commit is contained in:
Denis Shulyaka
2020-06-23 02:41:53 +03:00
parent 2cc9d70915
commit 9ba0de67f5
4 changed files with 2 additions and 139 deletions

View File

@@ -1,62 +0,0 @@
import { css, CSSResult, html, TemplateResult } from "lit-element";
import { HaEntityToggle } from "./ha-entity-toggle";
class HaEntityHumidifier extends HaEntityToggle {
protected render(): TemplateResult {
if (!this.stateObj) {
return super.render();
}
return html`
<div class="target">
${this.stateObj.attributes.mode
? html`<span class="state-label">
${this.hass!.localize(
`state_attributes.humidifier.mode.${this.stateObj.attributes.mode}`
) || this.stateObj.attributes.mode}
</span>`
: ""}
<div class="unit">
${this.stateObj.attributes.humidity
? html`${this.stateObj.attributes.humidity} %`
: ""}
</div>
</div>
${super.render()}
`;
}
static get styles(): CSSResult {
return css`
:host {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.target {
color: var(--primary-text-color);
}
.current {
color: var(--secondary-text-color);
}
.state-label {
font-weight: bold;
text-transform: capitalize;
}
.unit {
display: inline-block;
direction: ltr;
}
${super.styles}
`;
}
}
customElements.define("ha-entity-humidifier", HaEntityHumidifier);