Minimize state and do more with fewer types

On the Simple IoT project, still working on the schedule implementation. It is more work than anticipated, but it is turning out well. One technique that has been clarified through this feature implementation is how to keep track of state in a UI widget when a value is partially entered. For example, when a time is entered in local time in the browser, but stored as UTC in the frontend model/backend DB, you can’t do the UTC conversion when the time is partially entered. How do you keep track of state while the time is being entered? You could add another state variable to the model. However, a far simpler technique is to simply store the state in the variable you are entering (perhaps prefix it with a special letter or something. We already do this when entering floating point numbers. In this case, we store a magic value in the point Text field when the number is blank. This eliminates automatically turn a blank into a zero and handles the case when you have a ‘.’ entered without any decimal numbers yet. Any time you can avoid adding additional state, this seems to be a good thing. This also illustrates a common theme of the SIOT project – do more with fewer types.