Skip to content

Commit 7b9ca05

Browse files
authored
Fix static icon definition
1 parent 1faaaa6 commit 7b9ca05

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

custom_components/makerspaceapi/sensor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ class BookingTargetSensor(MakerSpaceEntity, SensorEntity):
118118
_attr_state_class = SensorStateClass.MEASUREMENT
119119
_attr_native_unit_of_measurement = CURRENCY_EURO
120120
_attr_suggested_display_precision = 2
121-
_attr_icon = "mdi:cash"
122121

123122
def __init__(
124123
self, coordinator: MakerSpaceCoordinator, entry: ConfigEntry, slug: str
@@ -143,7 +142,7 @@ def icon(self) -> str:
143142
t = self._target()
144143
if not t:
145144
return "mdi:cash-sync"
146-
return "mdi:cash" if t["balance"] > 0 else "mdi:cash-off"
145+
return "mdi:cash" if float(t["balance"]) > 0 else "mdi:cash-off"
147146

148147
@property
149148
def native_value(self) -> float | None:

0 commit comments

Comments
 (0)