Skip to content

Commit

Permalink
Merge pull request #153 from cgiesche/streamdeck-homeassistant-150
Browse files Browse the repository at this point in the history
Fixed #150: Wrong Fahrenheit to Celsius conversion.
  • Loading branch information
cgiesche committed May 30, 2023
2 parents a2c8133 + dfdfa19 commit a8e87f7
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 a8e87f7

Please sign in to comment.