Skip to content

Commit

Permalink
Fixed #150: Wrong Fahrenheit to Celsius conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgiesche committed May 30, 2023
1 parent a2c8133 commit dfdfa19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/plugin/entityButtonImageFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@ export class EntityConfigFactory {
"temperature": (state, attributes, templates) => {
const icon = Mdi.mdiThermometer;

let nonRetardedTemperature = 0 + state;
let temperature = 0 + state;
if (attributes.unit_of_measurement === "°F") {
nonRetardedTemperature = nonRetardedTemperature / 1.8
temperature = (temperature - 32) * 5/9;
}

let color = "#00a400";
if (nonRetardedTemperature < 5) {
if (temperature < 5) {
color = "#3838f8";
} else if (nonRetardedTemperature > 25) {
} else if (temperature > 25) {
color = "#fa4848";
}

Expand Down

0 comments on commit dfdfa19

Please sign in to comment.