1 """Local storage for the Local To-do integration."""
4 from pathlib
import Path
10 """Local storage for a single To-do list."""
12 def __init__(self, hass: HomeAssistant, path: Path) ->
None:
13 """Initialize LocalTodoListStore."""
16 self.
_lock_lock = asyncio.Lock()
19 """Load the calendar from disk."""
20 async
with self.
_lock_lock:
21 return await self.
_hass_hass.async_add_executor_job(self.
_load_load)
24 """Load the calendar from disk."""
25 if not self.
_path_path.exists():
27 return self.
_path_path.read_text()
30 """Persist the calendar to storage."""
31 async
with self.
_lock_lock:
32 await self.
_hass_hass.async_add_executor_job(self.
_store_store, ics_content)
34 def _store(self, ics_content: str) ->
None:
35 """Persist the calendar to storage."""
36 self.
_path_path.write_text(ics_content)
None async_store(self, str ics_content)
None _store(self, str ics_content)
None __init__(self, HomeAssistant hass, Path path)