Is there an way to read the default bike out of the profile?

Comments

1 comment

  • Avatar
    Zalvato

    Hi John,

    you're not missing anything – I ran into the same wall while building my extension (WaxLog). As of karoo-ext 1.1.9, an extension's RideProfile only has id, name, pages, indoor, defaultActivityType and routingPreference – no bike. The Bikes event gives you the Karoo bikes (id, name, odometer), but nothing links a profile to its default bike.

    Two workarounds I know of:
    • Map profiles to bikes inside the extension – the user links each ride profile to a bike once. That's what WaxLog does; the catch is one profile per bike.
    • Compare each bike's odometer before and after a ride – the one that grew should be the bike that was ridden. I haven't verified yet when exactly the Karoo updates the odometer, so treat that one as an idea, not a recipe.

    An official field for the profile's default bike would make all of this much simpler.

    0
    Comment actions Permalink

Please sign in to leave a comment.