Open magx2 opened 1 month ago
I have not dug into deep sleep yet, so please enligthen me; what needs to be added to the binding?
I would imagine this:
deepSleep
- if it's enabled the the rest of the algorithm appliesdeepSleepReconnect
- this is value for scheduleReconnect (right now it's hardcoed 40 secs)deepSleepMaxRetries
- after how many reconnects the device should be considered offlinedeepSleepMaxRetries
. Also do not log in WARN
"[{}] Error initial connection"
(I had to turn off logs for this class, because it was killing me)So my use case would look like this:
deepSleep=true
deepSleepReconnect=10 // try every 10 secs to connect to device
deepSleepMaxRetries=270 // 45 min / 10 secs = 270 - my device turns on every 45 mins so this should work just fine
OH would try to connect to ESP every 10 secs and after 270 attempts (not earlier) it would put my thing as offline
before reaching 270 attempts:
after 270 attempts:
And of course if it will establish connection with ESP at least once it will be online all the time (unless 270 attempts threshold will be hit)
Ok, then I understand what you mean. I'll take a look - or feel free to create a PR :)
Any luck?
Just a quick look so far, but regular life got in between.
If you'll create a PR I'll try to prioritize reviewing and merging it
Hey,
I'm using your library to connect with my ESP that has an eink screen. This device runs on a battery, so I need to use deep sleep to extend its battery life. My use case looks like this:
I see that this use case is not currently supported by your software. Are you able to add it?