Closed thncode closed 5 years ago
InitialTime is set upon the first entry is actually written into the history. It means that you may have to wait the internal fakegato time. What accessory type is yours? also, if you are using a debugger you can see how the fakegato structure is.
Are you using file persistence? If so, fakegato will wait for the history to be loaded before adding any entry or setting the initialTime variable. You can check if the is history is loaded with isHistoryLoaded
I see. Could the missing initialTime be a result of switching from 0.4.0 to 0.5.3 while developing the contact sensor accessory?
There was no change to initialTime from 0.4.0 to 0.5.3, but the retrieving mechanism for the persisted history was improved. I suggest you to try with 0.5.3 without persistence, then switch on filesystem persistence removing the previous history file, and check what happens I
Can you give me a hint how to switch from persisted history to non-persisted and back?
it is configured with the constructor. Refer to https://github.com/simont77/fakegato-history#history-persistence
I solved it. for some strange reason the history file was 0 length and could not be overwritten by the plugin. after deletion everything worked like it should... Thx!
sorry - it's me again. I am doing a series of contact switches. while all other FakeGato mechanisms do work getInitialTime() always returns undefined. Any idea?