Mirror the state value yes. What you couldn't do is click "poll" or "refresh" to have it query the calendar immediately. That would have to happen on the GCal switch. This is where I was struggling before linking those commands to the "parent" app.
You can download these files in the Beta folder. Please update all three files. Its worth noting that I built upon the Beta enhancements that @neerav.modi is currently testing. Please let me know if this works and feedback on the instructional text.
I like the ability to control other switches. Matter of fact, I definitely want to use @rakeshg's request. However, can you put an on/off toggle to be able to reverse the action? e.g. if the toggle is on, those switches would be turned ON when Google switch turns on. If the toggle is off, those switches would be turned OFF when the Google Switch is turned on.
The request I was trying to make was to have a button in the google switch to resync the calendars, right next to the On, Off, Poll, and Refresh buttons. And a link in the child app to resync the calendars and another link to go to directly to the google switch. This request is just for convenience, NOT required, so I would be ok if you can't or don't want to do it. Right now, for testing, I make a change the in child app, I have to save it, go to apps list, open the parent app, go to Utilities, click clear cache, click sync calendars, then go to devices, open the Google Switch, and then watch see if the next event is correct, and then go to logs, then past history to see the debug info.
After having updated all 3 to the beta version (apps: 2.3.0.3, driver: 2.3.0), it's broken. My google search is: -busy -lunch -"focus time". In debugging, the BEFORE results are correct, the AFTER doesn't have any events. Further testing shows that the quotes in the (valid) google query causes a problem in the AFTER. Removing the quotes and altering the search works, but obviously not as I would prefer it to.
And one more request: the option to ignore all-day events.
The sequential vs non-sequential appears to work correctly in beta 2.3.0.3 for the first meeting in the morning. So, the option is successful so far! I'm working away from my desk until Friday, so I won't be able to give detailed feedback regarding non-sequential and the -10 minute offset for every single event throughout the day. You'll hear more from me late Friday.
Actually it’s there Poll or Refresh buttons cause a query to the calendar. In fact the scheduled jobs are basically calling the child switch Poll function, refresh just calls Poll. The original app used these names plus they are native capabilities so I just left them.
Will look into this but probably hide them by default with a toggle as the app page is getting super long.
Hum will test this out. When you mean before, was that your edited code of v2.2?
@neerav.modi I tested this scenario out using your -"focus time" example and was able to replicate the issue. I neglected to update the GCal Search Trigger child app code to utilize Google Matching so that is why its broken. I will get that squared away along with some of the other ideas in the next version.
@neerav.modi I just posted BETA v2.3.0.5 as @rakeshg found an issue. If you are using "Google Matching" for all your search triggers, you won't encounter the issue I just fixed and can continue to use v2.3.0.4.
I will let things settle for a few days and told @rakeshg that I would publish this code to the main branch as v2.3.1 late weekend or early next week if yall don't encounter any issues. Thanks again for testing these changes and the ideas to enhance this app.
There was a previous unreported bug that seems to be fixed now. Every time the calendar synced (15 minutes), the Google switch would briefly turn on an then back to the default off, which kept triggering rules. Doesn't appear to be an issue in 2.3.0.6.
Added an option to use Google Query Matching. By default calendar event matching is done by the HE hub and it allows multiple search strings. Caching of events is not supported when using Google query matching.
Added ability to prefix search words with a "-" (minus) to exclude events with this word in the title or location.
Added ability to exclude All Day Events (default is to include)
Added ability to set whether sequential events will expand the scheduling of when the child switch turns off. If this is turned off, the switch will turn off 1 minute in advance of calendar event end time to ensure the toggle can happen. You can override this via the Event End Offset setting.
Added ability to toggle/sync additional switches. A list of switches can be designated to synchronize and a list of switches can be designated to reverse the switch state as the child calendar switch is toggled.
Could you clarify the advantages of this? I'm assuming that it takes a bit of the load off the HE when scraping the data?
Edit: After updating I read the description in the app and it explained it well enough disregard by question please
Edit 2: I noticed the HPM installed a new "GCal switch driver" instead of updating the existing one, not sure if that was intended? All of my switches still referenced the original "old" code so I went ahead and manually updated the existing switch to the new code.
Cool on the edit but just to make sure folks are clear, in working with @neerav.modi it was requested to replicate many of Google's search features such as -, "", etc which became a challenge. Decided to provide an option at the individual search trigger level to leverage Google's search features if desired. Caching of events doesn't work with this option. Worth noting that I had several "false positives" using it in the past and it also doesn't support multiple search strings like the default HE matching does where multiple strings can be separated by commas.
I didn't experience this with my "production" hub. FWIW I develop this on my "dev" hub and use HPM like everyone else to keep updates to my production version of this. I didn't get a duplicate driver and curious if others experience it because I didn't change anything in the HPM settings other than the version and release notes.
Ya, I thought it was kind of strange as I also noted it didn't appear to be any different with the exception of the version.
EDIT: In hindsight, I may have caused the problem myself. I think I manually installed the app copying the code from another hub and originally missed the "switch driver" code which I then installed after I got some errors. I may have installed HPM and marked it as "up to date" before I manually added the "switch" driver" which probably gummed something up.