vingerha / gtfs2

Support GTFS in Home Assistant GUI-only
https://github.com/vingerha/gtfs2
MIT License
65 stars 4 forks source link

[FEATURE]: Increase max range in "CONF_RADIUS" #46

Closed cvc90 closed 2 months ago

cvc90 commented 2 months ago

Hi @vingerha,

Currently the variable "CONF_RADIUS" is set with min=50, max=500, I think that for cities it is correct but for small towns or remote houses I think it should be possible to increase the range to 1500M or even more.

How about increasing the max range of this variable in the config_flow.py file? Thank you.

vingerha commented 2 months ago

I myself live in a small town and just took 'something' that applied to me. When in a city 500m already could explode the response and slow it down (dead) esp. if you have additional real-time setup. Alternatives are to create other 'areas' and use that but the reporting in HA becomes mre complex too. Hence, will extend it to 2km (??) and add a warning ...would that help?

cvc90 commented 2 months ago

I think it could be useful in many cases to be able to increase the range, as for example in the house in the village that only has one stop for the whole village and is more than 500M, with the current configuration could not make it work.

I understand what you say that it could saturate "HA", but with a warning would be good for people to be warned of the consequences of putting a high range, the vast majority of users will not touch the default range setting.

vingerha commented 2 months ago

I am a bit concerned because of the risk. If you raise it too high it could kill HA and a reboot will not help as it would start again, requiring diving into the .storage folder with even more risks. I need to think this through, possibly do a initial 'call' to check #stops...

cvc90 commented 2 months ago

Regular people with the range at 400M (default) like this currently will not have problems, by increasing the maximum range since it will not modify their current range.

People who increase the range between 500M and 1500M may have problems if they are using it in an inappropriate place such as in the city, it would be due to poor user configuration, in this case we can limit it to only 1 stop, so as not to saturate it.

People who increase the range between 500M and 1500M and use it in cases like the one I mentioned should not have any type of problem.

I understand your concern but in general no one should modify the "range" unless it were the special case that I mentioned, because in option 2 it would not make sense. Maybe putting a validator option so that people understand the risk of using a larger range and only for exceptional cases could it be another option?

vingerha commented 2 months ago

I will need to add 'some' limit to avoid people having to search for recovery options. A lot of people have no clue of fear tampring in de deep of HA so I need to limit it somewhere. Instead of lmitting by distance I will now aim (!) to limit it by number of stops within the range and will initially start with max 15...no clue as well here to what this leads

vingerha commented 2 months ago

In other words...you know as well as I that people do not read the risks/conditions (myself included) and the damage is too high if they skip understanding their choice

vingerha commented 2 months ago

Just for my thoughts and yours.. I may be able limit it to the top 15 stops closest to the location/zone/person

vingerha commented 2 months ago

Resolved with 0.4.4. Max radiis is now 5000 but a hard limit if this surpasses 15 stops

cvc90 commented 2 months ago

Resolved with 0.4.4. Max radiis is now 5000 but a hard limit if this surpasses 15 stops

I think it is more than enough for rural use.

Thanks for the improvement 😄