Skip to content

Commit 089341b

Browse files
Fixed the other sensor libraries
1 parent 61bb5f3 commit 089341b

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

electroblocks/core.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ def config_dht_temp(self, pin, type):
194194
def dht_temp_celcius(self):
195195
pin = self.pins[ComponentPins.TEMP][0]
196196
[humidity, temp] = self._find_sensor_str(pin, "dht").split('-')
197-
return temp
197+
return float(temp)
198198

199199
def dht_temp_humidity(self):
200200
pin = self.pins[ComponentPins.TEMP][0]
201201
[humidity, temp] = self._find_sensor_str(pin, "dht").split('-')
202-
return humidity
202+
return float(humidity)
203203

204204
# Thermistor
205205

@@ -209,15 +209,12 @@ def config_thermistor(self, pin):
209209

210210
def thermistor_celsius(self):
211211
pin = self.pins[ComponentPins.THERMISTOR][0]
212-
return self._find_sensor_str(pin, "th")
212+
return float(self._find_sensor_str(pin, "th"))
213213

214214
def thermistor_fahrenheit(self):
215215
pin = self.pins[ComponentPins.THERMISTOR][0]
216216
temp = self._find_sensor_str(pin, "th")
217-
if (temp == ''):
218-
return ''
219-
else:
220-
return 32 + (9/5 * float(temp))
217+
return float(32 + (9/5 * float(temp)))
221218

222219
#IR Remote
223220

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "electroblocks"
7-
version = "0.1.22"
7+
version = "0.1.23"
88
description = "Python client library to interact with ElectroBlocks Arduino firmware"
99
authors = [
1010
{ name = "Noah Glaser", email = "[email protected]" }

0 commit comments

Comments
 (0)