Skip to content

Commit

Permalink
fix: Only show state string if hvac_action is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
kangaroomadman authored and nervetattoo committed Apr 11, 2021
1 parent 1ea41b3 commit a7638b3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/components/sensors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ export default function renderSensors({
type: 'table',
labels: true,
}
const stateString = [
localize(action, 'state_attributes.climate.hvac_action.'),
' (',
localize(state, 'component.climate.state._.'),
')',
].join('')
var stateString = localize(state, 'component.climate.state._.')
if (action) {
stateString = [
localize(action, 'state_attributes.climate.hvac_action.'),
' (',
stateString,
')',
].join('')
}
const sensorHtml = [
renderInfoItem({
hide: _hide.temperature,
Expand Down

0 comments on commit a7638b3

Please sign in to comment.