README.md (1402B)
1 # Waldhart availability 2 3 Read and process availability from Waldhart software. 4 5 Update availability on a CalDAV server (as events). 6 7 An example environment file with the configuration options is given in `env`. 8 9 ## Development setup 10 ```bash 11 python -m venv .venv 12 source .venv/bin/activate 13 pip install -r requirements.txt 14 ``` 15 16 ## Tests 17 ```bash 18 coverage run .venv/bin/pytest 19 ``` 20 21 ## Waldhart authentication 22 Get session cookie: 23 ```bash 24 curl -b cookies.txt \ 25 -F'username=<USERNAME>' -F'password=<PASSWORD>' 26 "https://savognin-desk.skischoolshop.com/login" 27 ``` 28 29 ## Availability Data 30 Check availability in Dec 2024: 31 ```bash 32 curl -s -H "Cookie: session_id=<SESSION_ID>" \ 33 "https://savognin-desk.skischoolshop.com/myavailability/myavailability_month/get_availability_json?year=2024&month=12" | jq 34 ``` 35 36 Example response not available (NV): 37 ```json 38 "14": { 39 "not_available": true, 40 "on_call": false, 41 "pm": false, 42 "am": false, 43 ``` 44 45 Example available at forenoon (AM, 08:00 - 12:00): 46 ```json 47 "9": { 48 "not_available": false, 49 "on_call": false, 50 "pm": false, 51 "am": true, 52 }, 53 ``` 54 55 Example available at afternoon (PM, 12:00 - 16:00): 56 ```json 57 "20": { 58 "not_available": false, 59 "on_call": false, 60 "pm": true, 61 "am": false, 62 }, 63 ``` 64 65 Example skiing/available all day: 66 ```json 67 "3": { 68 "not_available": false, 69 "on_call": false, 70 "pm": true, 71 "am": true, 72 ```