BobS
I’d fully advise them of your plan to apply the deposit on the last day of the grace period to pay rent–usually 5 days. Try to get their acquiescence, be friendly & reasonable, showing them how they will be protected. IF they then chose to give a 3-day notice, then the clock starts ticking. Your goal is to keep pushing the date back until it becomes moot.
They have to SERVE you with the notice, which may take a few days (get the proper form, fill it out perfectly, serve it in person). Then there is, I believe, 3 weeks minimum after they file an unlawful detainer which cannot start until after the end of the 3-day notice period, weekends and holidays not counted. This should put you easily into September. Besides, you can further delay the court date by ANSWERING the complaint on the form you are served on. This gives many more days.
IF you show up in court with all your evidence, you should prevail, but will most likely not be necessary.