Skip to content

Commit

Permalink
Update TemperatureController.py
Browse files Browse the repository at this point in the history
  • Loading branch information
beniroquai committed Mar 11, 2024
1 parent 0900f03 commit 9d746a8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ def __init__(self, *args, **kwargs):
self.Ki = 0.1
self.Kd = .5
self.PIDenabled = False
self.pollingPeriod = 5

# get hold on the Temperature Controller
try:
self.temperatureController = self._master.rs232sManager["ESP32"]._esp32.temperature
self.temperatureController.start_temperature_polling(period=self.pollingPeriod)
except:
return
# Connect TemperatureWidget signals
Expand Down Expand Up @@ -130,7 +132,7 @@ def updateSetPointData(self):
def updateMeasurements(self):
while self.is_measure:
self.temperatureValue = self.temperatureController.get_temperature()
if self.temperatureValue > -200: # if not, we have faulty values
if self.temperatureValue and self.temperatureValue > -200: # if not, we have faulty values

self._widget.updateTemperature(self.temperatureValue)

Expand Down

0 comments on commit 9d746a8

Please sign in to comment.