matsstaff / stc1000p

Programmable thermostat firmware and arduino based uploader for the STC-1000 thermostat
GNU General Public License v3.0
261 stars 47 forks source link

millisx60 should be reset when updating dh config value #107

Closed fredericsureau closed 3 years ago

fredericsureau commented 4 years ago

I think the value of millisx60 should be reset when updating dh config value.

For example, if I set dh to 1 and at this moment millisx60 value is 59900, the step will end up almost instantly without waiting 1h as expected. I would expect this to work not only when using the menu interface, but when value is updated through communication as well.

I can propose a PR if you want, but I need more info on the implementation you imagine.

Thanks for the good work on this project!

matsstaff commented 4 years ago

Hi! It is sort of amazing there is still someone interested in this. I had a lot of fun with this project, but I have pretty much forgot about it :) I don't even have a development setup around anymore. I mean, I could probably still compile it and make a new version, but I'd have to do some serious junk diving to find a unit to test on...

To your question. Sure, you do have a valid point, millisx60 probably should be reset when updating dh. But that would mean a(nother) special case when storing the parameter. I didn't want to waste precious code space for extraneous special cases and the rationale being that the use case for changing a running profile (that could be running for days or weeks), would be that you'd might want to move along quicker than expected. An hour does not mean much in this context. So, I'd settle for simple and close enough :)

Feel free to have a 'hack' at it, if you really want this fixed, you'd probably want to add another 'if (config_item == dh)' around line 711 in page1.c. Personally, I don't see it as much as a bug, more of a design choice :)

fredericsureau commented 4 years ago

Hi! Thanks for your reply. We actually use patched STC1000 for fermentation control at our brewery Brasserie du Vieux Singe, Rennes, France. Of course you're welcome to get some beer if you ever go to France one day!

Back to code, I think we can live with this "design choice" ;) I will publish a PR if I ever decide to patch the code.

Cheers