DrossStudios / cool_chook

To control chicken-coop climate based on thermal sensors and presumed time-of-year.
2 stars 0 forks source link

Logger.poll_log() doesn’t actually update devices #8

Open DrossStudios opened 10 months ago

DrossStudios commented 10 months ago

To quote Mark Watney, The Martian, “Because I’m stupid…” I forgot that passing a class instance into a function as an argument effectively creates a copy of the instance, and any constituent values changed happen to that copy within that function, not the original instance.

DrossStudios commented 10 months ago

The resolution plan is to first ctrl-x/ctrl-v all classes from main.py to c4.py (the necessary import commands have already been put in place for both), then run various in-terminal tests. I’ll also need to write some in-file tests that more-tightly control what-if parameters, within c4.py.

I anticipate that I will end up deleting Logger.poll_dev() and replacing it with a permanent logging functionality built into System_Info.poll_dev(); maybe add a boolean toggle depending on whether I want to take up precious storage with copious log files.