Skip to content

Commit a67771e

Browse files
Merge pull request #39 from altaic/altaic-patch-1
Fix radon_level attribute to use unit_scale
2 parents 1e96d9b + 3d87474 commit a67771e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

custom_components/airthings_wave/sensor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ def transform(self, value):
132132

133133
class RadonSensor(Sensor):
134134
def get_extra_attributes(self, data):
135-
if VERY_LOW[0] <= float(data) <= VERY_LOW[1]:
135+
if float(data) <= self.transform(VERY_LOW[1]):
136136
radon_level = VERY_LOW[2]
137-
elif LOW[0] <= float(data) <= LOW[1]:
137+
elif float(data) <= self.transform(LOW[1]):
138138
radon_level = LOW[2]
139-
elif MODERATE[0] <= float(data) <= MODERATE[1]:
139+
elif float(data) <= self.transform(MODERATE[1]):
140140
radon_level = MODERATE[2]
141141
else:
142142
radon_level = HIGH[2]

0 commit comments

Comments
 (0)