Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/panels/lovelace/cards/hui-entities-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard {
return css`
ha-card {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.card-header {
display: flex;
Expand All @@ -199,6 +202,10 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard {
text-overflow: ellipsis;
}

#states {
flex: 1;
}

#states > * {
margin: 8px 0;
}
Expand Down
6 changes: 6 additions & 0 deletions src/panels/lovelace/cards/hui-entity-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ export class HuiEntityCard extends LitElement implements LovelaceCard {

static get styles(): CSSResult {
return css`
ha-card {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
ha-card > div {
cursor: pointer;
}
Expand Down
38 changes: 18 additions & 20 deletions src/panels/lovelace/cards/hui-light-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,17 @@ export class HuiLightCard extends LitElement implements LovelaceCard {
<div class="content">
<div id="controls">
<div id="slider">
${supportsFeature(stateObj, SUPPORT_BRIGHTNESS)
? html`
<round-slider
min="0"
.value=${brightness}
@value-changing=${this._dragEvent}
@value-changed=${this._setBrightness}
></round-slider>
`
: ""}
<round-slider
min="0"
.value=${brightness}
@value-changing=${this._dragEvent}
@value-changed=${this._setBrightness}
style=${styleMap({
visibility: supportsFeature(stateObj, SUPPORT_BRIGHTNESS)
? "visible"
: "hidden",
})}
></round-slider>
<paper-icon-button
class="light-button ${classMap({
"slider-center": supportsFeature(
Expand Down Expand Up @@ -322,6 +323,13 @@ export class HuiLightCard extends LitElement implements LovelaceCard {
color: var(--paper-item-icon-color, #44739e);
width: 60%;
height: auto;
position: absolute;
max-width: calc(100% - 40px);
box-sizing: border-box;
border-radius: 100%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

.light-button.state-on {
Expand All @@ -332,16 +340,6 @@ export class HuiLightCard extends LitElement implements LovelaceCard {
color: var(--state-icon-unavailable-color);
}

.slider-center {
position: absolute;
max-width: calc(100% - 40px);
box-sizing: border-box;
border-radius: 100%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

#info {
text-align: center;
margin-top: -56px;
Expand Down
38 changes: 24 additions & 14 deletions src/panels/lovelace/cards/hui-thermostat-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,24 +239,26 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
tabindex="0"
></paper-icon-button>

<div id="controls">
<div id="slider">
${slider}
<div id="slider-center">
<div id="temperature">
${currentTemperature} ${setValues}
<div class="content">
<div id="controls">
<div id="slider">
${slider}
<div id="slider-center">
<div id="temperature">
${currentTemperature} ${setValues}
</div>
</div>
</div>
</div>
</div>
<div id="info">
<div id="modes">
${(stateObj.attributes.hvac_modes || [])
.concat()
.sort(compareClimateHvacModes)
.map((modeItem) => this._renderIcon(modeItem, mode))}
<div id="info">
<div id="modes">
${(stateObj.attributes.hvac_modes || [])
.concat()
.sort(compareClimateHvacModes)
.map((modeItem) => this._renderIcon(modeItem, mode))}
</div>
${name}
</div>
${name}
</div>
</ha-card>
`;
Expand Down Expand Up @@ -423,6 +425,7 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
}

ha-card {
height: 100%;
position: relative;
overflow: hidden;
--name-font-size: 1.2rem;
Expand Down Expand Up @@ -481,6 +484,13 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
z-index: 25;
}

.content {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
}

#controls {
display: flex;
justify-content: center;
Expand Down