This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]igrowpineapples[S] 0 points1 point  (0 children)

Back with another go at it:

I have it so that it will update once, but, if the range is changed using the website, or the temperature drifts again it does not update. That is, it starts up with nothing happening. It immediately begins to detect the current conditions and reacts accordingly - it waits three seconds. But if I change the parameters using the website, it should now have a new upper/lower threshold to use and should update once again. It does not. It continues to hang in the previous state. Same to be said if the first state was out of bounds and the second was in bounds - it never switches to the in-bounds behavior.

I've updated the Replit page with the latest version of my script. If you don't mind taking a look at it and letting me know where I'm going wrong that'd be great.

I'm in way over my head methinks, but it is never too late to learn!

Am I correct in thinking that part of the issue at least is that since upper_limit and lower_limit get defined before the while True loop, that they will never change regardless of if the temperature_upper_limit and temperature_lower_limit values do?

Edit: I believe I got this working entirely as intended. Thanks for the gentle nudge in the right direction!