Raistlfiren / garmin-csv-plan

A quick n' dirty way of "automating" training plans into Garmin Connect.
https://raistlfiren.github.io/garmin-csv-plan/
36 stars 6 forks source link

Added sub repeaters and workouts as Yaml #10

Closed pygoubet closed 3 years ago

pygoubet commented 3 years ago

Support of sub repeaters (repeat step in a repeat step).

Workout example:

running: test repeat
- warmup: 20:00 @z2 ;L0 warmup z2
- repeat: 2
  - warmup: 1:00 @z3 ;L1 warmup z3
  - repeat: 3
    - repeat: 4
      - run: 00:30 @3:30-3:46 mpk ;@105%VMA
      - recover: 00:30 ;L3 recover
    - recover: 2:00 @z2 ;L2 recover
  - recover: 2:00 @z2 ;L1 recover
- recover: 10:00 @z1 ;L0 recover

Internally, the parsing of the workout string is facilitated by treating it as a Yaml document.

Raistlfiren commented 3 years ago

Sorry, I have been meaning to test your code. Give me a few days over this holiday and I will review things. Thank you sir.

Raistlfiren commented 3 years ago

This broke steps and I had to revert the commit. One of the issues has to do with the following:

running: 3.5-4h run
- run 225:00
- cooldown: lap-button
pygoubet commented 3 years ago

Isn't it related to the missing ":" after the key "run"?

Raistlfiren commented 3 years ago

Yeah sorry, typo. It doesn't work with run: 225:00 either Working on a fix.

pygoubet commented 3 years ago

Weird, this below works with no issue

cat >test.csv<<EOF
"WEEK","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"
"1","running: 3.5-4h run
- run: 225:00
- cooldown: lap-button","","","","","",""
EOF
./bin/console garmin:workout test.csv import -n