giuseppeg88 / node-red-contrib-thermostat-scheduler

The Ultimate Node-RED Thermostat for Home Assistant - A NEST style thermostat with: temperature week scheduler, countdown and manual mode
GNU General Public License v3.0
67 stars 28 forks source link

refactor needed #11

Open Edo78 opened 3 years ago

Edo78 commented 3 years ago

Hi, I'm looking at your flow to change it from depending on a file to using a persistent context but I noticed that you use context in an undocumented way and I'm not sure what are you trying to achieve. eg.

context.days
context.selector
context.saving

It looks like you are trying to have those properties persisted in a context (the flow one?) but it doesn't look the right way to do it https://nodered.org/docs/user-guide/writing-functions#context

I'm going to refactor it, are you interested in a PR?

giuseppeg88 commented 3 years ago

Hi Edo, I am unable to give you more information because, for this piece of code, I used the flow written by Peter Scargill: https://tech.scargill.net/a-thermostat-weekend/.

Of course, feel free to propose any improvements.

Thanks!