WazeRouteCalculator icon indicating copy to clipboard operation
WazeRouteCalculator copied to clipboard

Add support to region BR

Open coelholm opened this issue 3 years ago • 6 comments

Add support to Brazil Minor fix to example codes in the README.md, it was missing "import logging"

coelholm avatar Apr 16 '21 07:04 coelholm

Coverage Status

Coverage remained the same at 95.2% when pulling c30cb18d7848be0c928ec1bdee91f482adbdc153 on coelholm:master into 899220e1d678527000ef554cf3a5cb1e40870488 on kovacsbalu:master.

coveralls avatar Apr 16 '21 07:04 coveralls

Without this change it is not possible to calculate routes in Brazil. Is there any reason not to accept this merge? @kovacsbalu I have interest on this change because I use it with Home Assistant to calculate distances (iCloud3 tracker). Every version update I have to manually change the container and add my version of this code.

coelholm avatar Sep 29 '21 20:09 coelholm

@coelholm what do you think about this solution? base_coord_from_env

kovacsbalu avatar Oct 01 '21 13:10 kovacsbalu

@coelholm what do you think about this solution? base_coord_from_env

It will add flexibility to base coordinate and that is good. I believe it is possible to keep env vars persistent in the container of Home Assistant - Device Tracker iCloud3, but I will need to update that every time there is new release of home assistant core.

What do you think about adding it after region as an option? Something like: region,lat,long,coord_server,route_server That way you can overwrite hard coded configuration and allow for customization. In my case, instead of configuring region as 'br' I would use 'br,-22.951,-43.210,row-SearchServer/mozi,row-RoutingManager/routingRequest' This way it is possible to keep that customization in a configuration file and it will survive home assistant updates.

Of course It would require some changes of validation code from iCloud3, but I believe it is a minor update and I can propose that as well.

coelholm avatar Oct 01 '21 19:10 coelholm

Hi @coelholm, I see your point but I really don't like too many parameters. Now it has 8 which is a lot. ( I will refact a bit and remove these from init.) What do you think about the python @property decorator?

kovacsbalu avatar Oct 19 '21 06:10 kovacsbalu

Hi @coelholm, I see your point but I really don't like too many parameters. Now it has 8 which is a lot. ( I will refact a bit and remove these from init.) What do you think about the python @property decorator?

Sorry for the delay. So your plan is to remove hard coded configuration related to servers and allow developers to define that on the fly, using @property methods 'getter, setter, deleter', isn't it? Sound good to me, that way it will be easy to support any area in the world.

coelholm avatar Nov 04 '21 18:11 coelholm