Skip to content

Commit

Permalink
Bugfix: Leaf Offset Sensor check if state exist (sorry finally >.<)
Browse files Browse the repository at this point in the history
  • Loading branch information
mentalilll committed Aug 12, 2024
1 parent eb60902 commit 8bb530f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const bar = {
const temperature = parseFloat(this._hass.states[sensor.temperature].state);
let leafTemperature = temperature - this.getLeafTemperatureOffset();
if (sensor.leaf_temperature !== undefined) {
if (this._hass.states[sensor.leaf_temperature].state !== undefined) {
if (this._hass.states[sensor.leaf_temperature] !== undefined) {
leafTemperature = parseFloat(this._hass.states[sensor.leaf_temperature].state);
}
}
Expand Down Expand Up @@ -103,7 +103,7 @@ export const bar = {
const temperature = this.toFixedNumber(this._hass.states[sensor.temperature].state, 1);
let leafTemperature = this.toFixedNumber(temperature - this.getLeafTemperatureOffset());
if (sensor.leaf_temperature !== undefined) {
if (this._hass.states[sensor.leaf_temperature].state !== undefined) {
if (this._hass.states[sensor.leaf_temperature] !== undefined) {
leafTemperature = this.toFixedNumber(this._hass.states[sensor.leaf_temperature].state);
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export const chart = {
const temperature = parseFloat(this._hass.states[sensor.temperature].state);
let leafTemperature = temperature - this.getLeafTemperatureOffset();
if (sensor.leaf_temperature !== undefined) {
if (this._hass.states[sensor.leaf_temperature].state !== undefined) {
if (this._hass.states[sensor.leaf_temperature] !== undefined) {
leafTemperature = parseFloat(this._hass.states[sensor.leaf_temperature].state);
}
}
Expand Down
1 change: 0 additions & 1 deletion dist/ha-vpd-chart-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export class HaVpdChartEditor extends HTMLElement {
if (config.sensors.length === 0) {
config.sensors = [{
temperature: '',
leaf_temperature: null,
humidity: '',
name: ''
}];
Expand Down
2 changes: 1 addition & 1 deletion dist/ha-vpd-chart.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Set version for the card
window.vpdChartVersion = "1.4.7";
window.vpdChartVersion = "1.4.8";

import {methods} from './methods.js';
import {chart} from './chart.js';
Expand Down

0 comments on commit 8bb530f

Please sign in to comment.