summaryrefslogtreecommitdiff
path: root/src/browser/mod.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-08-18 07:32:25 +0200
committerSanto Cariotti <santo@dcariotti.me>2021-08-18 07:32:25 +0200
commit9b229737e671fba989191409e927e677a4c960f7 (patch)
tree90a0b9aa4b1dcefcd0ca81086d7dcb4f8e2925e0 /src/browser/mod.rs
parent655e487deb427c5b46e47aab50b761be78a1eb90 (diff)
feat: get timetable of a space
Diffstat (limited to 'src/browser/mod.rs')
-rw-r--r--src/browser/mod.rs11
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)
+}