more-info for thermostat-card (#2598)

* more-info for thermostat-card

* soften icon
This commit is contained in:
Ian Richardson 2019-01-30 13:35:41 -06:00 committed by Paulus Schoutsen
parent f22510fd74
commit f97b5c48d0

View File

@ -19,6 +19,7 @@ import { LovelaceCard, LovelaceCardEditor } from "../types";
import { LovelaceCardConfig } from "../../../data/lovelace";
import { loadRoundslider } from "../../../resources/jquery.roundslider.ondemand";
import { UNIT_F } from "../../../common/const";
import { fireEvent } from "../../../common/dom/fire_event";
const thermostatConfig = {
radius: 150,
@ -122,6 +123,11 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
small: !this._broadCard,
})}">
<div id="root">
<ha-icon
icon="hass:dots-vertical"
class="more-info"
@click="${this._handleMoreInfo}"
></ha-icon>
<div id="thermostat"></div>
<div id="tooltip">
<div class="title">${this._config.name ||
@ -328,6 +334,12 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
`;
}
private _handleMoreInfo() {
fireEvent(this, "hass-more-info", {
entityId: this._config!.entity,
});
}
private _handleModeClick(e: MouseEvent): void {
this.hass!.callService("climate", "set_operation_mode", {
entity_id: this._config!.entity,
@ -535,6 +547,14 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
vertical-align: top;
margin-left: var(--uom-margin-left);
}
.more-info {
float: right;
cursor: pointer;
padding-top: 16px;
padding-right: 16px;
z-index: 25;
color: var(--secondary-text-color);
}
</style>
`;
}