Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not picking up correct direction #17

Open
OppyLock opened this issue Apr 21, 2022 · 3 comments
Open

Not picking up correct direction #17

OppyLock opened this issue Apr 21, 2022 · 3 comments

Comments

@OppyLock
Copy link

I tried to setup a sensor for this service but it always sets the direction in the outbound direction.
VLine service, Geelong - Melbourne line, Melbourne direction, From Wyndham Vale Railway Station.

It tells me that:
Created configuration for Geelong - Melbourne line to Geelong from Wyndham Vale Railway Station.

It doesn't matter if I choose the Melbourne or Geelong direction it will always create the sensors in the Geelong direction.
The actual sensors show the direction ID as 21, where it should be 0 for inbound.

@miragebird
Copy link

miragebird commented May 13, 2022

Can confirm, also having the same issue for Traralgon line (VLine). No matter the selection of the directional selection on the GUI it always generates sesnors for outbound travel towards Traralgon.

@OppyLock
Copy link
Author

OppyLock commented Jun 8, 2022

Similar to issue #18 ... there's something fishy going on with return values when they are 0. Maybe it's interpreting it as none?
In any case, I was able to fix this by changing line 117-119 in config_flow.py
from:
data_schema = vol.Schema({
vol.Required(CONF_DIRECTION, default=next(iter(self.directions))): vol.In(self.directions),
})
to:
data_schema = vol.Schema({
vol.Required(CONF_DIRECTION, default=0): vol.In(self.directions),
})

@NathanReus
Copy link

Also seeing this same issue on VLine for 'Seymour - Melbourne via Broadmeadows'. Exactly as @OppyLock described; no matter which direction I choose, it always creates one to Seymour rather than to Melbourne.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants