diff options
author | Santo Cariotti <santo@dcariotti.me> | 2021-08-18 07:32:25 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2021-08-18 07:32:25 +0200 |
commit | 9b229737e671fba989191409e927e677a4c960f7 (patch) | |
tree | 90a0b9aa4b1dcefcd0ca81086d7dcb4f8e2925e0 /src/browser/mod.rs | |
parent | 655e487deb427c5b46e47aab50b761be78a1eb90 (diff) |
feat: get timetable of a space
Diffstat (limited to 'src/browser/mod.rs')
-rw-r--r-- | src/browser/mod.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/browser/mod.rs b/src/browser/mod.rs index 82c9c60..4c7ef8e 100644 --- a/src/browser/mod.rs +++ b/src/browser/mod.rs @@ -61,3 +61,14 @@ pub async unsafe fn select_option( Ok(false) } + +/// Get the timetable of available rooms +pub async unsafe fn get_timetable() -> WebDriverResult<Option<HashMap<String, String>>> { + if let Some(driver) = &WEB_BROWSER { + if let Some(timetable) = driver.get_timetable().await? { + return Ok(Some(timetable)); + } + } + + Ok(None) +} |