Skip to content

Commit

Permalink
fix: target_temperature unit not working #151 (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
regevbr committed Apr 1, 2024
1 parent d99850a commit 2b37f13
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mini-climate-card",
"version": "v2.7.1",
"version": "v2.7.2",
"description": "a/c card for Home Assistant Lovelace UI",
"keywords": [
"home-assistant",
Expand Down
5 changes: 5 additions & 0 deletions release_notes/v2.7.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## v2.7.2
[![Downloads](https://img.shields.io/github/downloads/artem-sedykh/mini-climate-card/v2.7.2/total.svg)](https://github.com/artem-sedykh/mini-climate-card/releases/tag/v2.7.2)

### Fixed
- fix: target_temperature unit not working #151 by @regevbr
2 changes: 0 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ class MiniClimate extends ScopedRegistryHost(LitElement) {

getTargetTemperatureConfig(config) {
const item = {
unit: '°C',
source: { entity: undefined, attribute: 'temperature' },
...config.target_temperature || {},
};
Expand Down Expand Up @@ -477,7 +476,6 @@ class MiniClimate extends ScopedRegistryHost(LitElement) {

this.config.temperature = {
round: 1,
unit: '°C',
source: { entity: undefined, attribute: 'current_temperature' },
...config.temperature || {},
};
Expand Down
2 changes: 1 addition & 1 deletion src/models/temperature.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class TemperatureObject {
}

get unit() {
return this.config.temperature.unit || this.config.target_temperature.unit;
return this.config.temperature.unit || this.config.target_temperature.unit || '°C';
}

get step() {
Expand Down

0 comments on commit 2b37f13

Please sign in to comment.