mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 02:49:51 +00:00
Removed humidifier row and a space in front of percent
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user