Skip to content

Commit a01197e

Browse files
committed
Correctly handle unit: false when formatting (#145)
1 parent 96dab61 commit a01197e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/entity.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ export const entityValue = (stateObj, config) =>
2424
config.attribute !== undefined ? stateObj.attributes[config.attribute] : stateObj.state;
2525

2626
export const entityUnit = (stateObj, config) =>
27-
config.attribute !== undefined ? config.unit : config.unit || stateObj.attributes.unit_of_measurement;
27+
config.unit === false
28+
? null
29+
: config.attribute !== undefined
30+
? config.unit
31+
: config.unit || stateObj.attributes.unit_of_measurement;
2832

2933
export const entityStateDisplay = (hass, stateObj, config) => {
3034
if (isUnavailable(stateObj)) {

0 commit comments

Comments
 (0)