Skip to content

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fineemb committed May 31, 2020
1 parent bd451f7 commit 61eeb64
Show file tree
Hide file tree
Showing 4 changed files with 328 additions and 359 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @Description :
* @Date : 2020-02-03 12:52:45
* @LastEditors : fineemb
* @LastEditTime : 2020-02-12 18:30:09
* @LastEditTime : 2020-05-31 11:11:26
-->

# Lovelace Thermostat Card
Expand All @@ -22,6 +22,11 @@ A simple thermostat implemented in CSS and SVG based on <a href="https://codepen
## Preview
![](https://bbs.hassbian.com/data/attachment/forum/202003/14/172544q3ajp7742cbo757h.gif)

## Update
### v1.3.0
+ fix icon
+ Fix the problem that the title blocks the arrow button [#16](https://github.com/fineemb/lovelace-thermostat-card/issues/16#issue-622934186)
+ Remove the small_i parameter and have done adaptive scaling
## HACS Installation
Search for Thermostat Card
## Manual Installation
Expand Down Expand Up @@ -50,7 +55,6 @@ Search for Thermostat Card
| entity | string | **Required** | The entity id of climate entity. Example: `climate.hvac`
| title | string | optional | Card title
| no_card | boolean | false | Set to true to avoid the card background and use the custom element in picture-elements.
| small_i | boolean | false | Set to true if you have 2 climate in one card. Default 1 big card. (Must clear browser cache after chageing this value)
| step | number | 0.5 | The step to use when increasing or decreasing temperature
| highlight_tap | boolean | false | Show the tap area highlight when changing temperature settings
| chevron_size | number | 50 | Size of chevrons for temperature adjutment
Expand Down
10 changes: 5 additions & 5 deletions dist/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {cssData} from './styles.js?v=1.2.9';
import ThermostatUI from './thermostat_card.lib.js?v=1.2.9';
console.info("%c Thermostat Card \n%c Version 1.2.9 ", "color: orange; font-weight: bold; background: black", "color: white; font-weight: bold; background: dimgray");
import {cssData} from './styles.js?v=1.3.0';
import ThermostatUI from './thermostat_card.lib.js?v=1.3.0';
console.info("%c Thermostat Card \n%c Version 1.3.0 ", "color: orange; font-weight: bold; background: black", "color: white; font-weight: bold; background: dimgray");
class ThermostatCard extends HTMLElement {
constructor() {
super();
Expand All @@ -9,7 +9,8 @@ class ThermostatCard extends HTMLElement {
set hass(hass) {
const config = this._config;
const entity = hass.states[config.entity];
let ambient_temperature = entity.attributes.current_temperature;
if(!entity)return;
let ambient_temperature = entity.attributes.current_temperature || 0;
if (config.ambient_temperature && hass.states[config.ambient_temperature])
ambient_temperature = hass.states[config.ambient_temperature].state;
let hvac_state = entity.state;
Expand Down Expand Up @@ -102,7 +103,6 @@ class ThermostatCard extends HTMLElement {
if (!cardConfig.step) cardConfig.step = 0.5;
if (!cardConfig.highlight_tap) cardConfig.highlight_tap = false;
if (!cardConfig.no_card) cardConfig.no_card = false;
if (!cardConfig.small_i) cardConfig.small_i = false;
if (!cardConfig.chevron_size) cardConfig.chevron_size = 50;
if (!cardConfig.num_ticks) cardConfig.num_ticks = 150;
if (!cardConfig.tick_degrees) cardConfig.tick_degrees = 300;
Expand Down
Loading

0 comments on commit 61eeb64

Please sign in to comment.