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

Adding subscriptions by channel number not working #10

Open
jamesremuscat opened this issue Aug 19, 2022 · 0 comments
Open

Adding subscriptions by channel number not working #10

jamesremuscat opened this issue Aug 19, 2022 · 0 comments

Comments

@jamesremuscat
Copy link

Attempting to add a subscription by channel number does not work (results in RuntimeError: coroutine raised StopIteration).

I think this is because it's attempting to match channel.number (which is an int) against self.option('rx-channel-number') (which is a str). I added a line of debugging to commands/subscription/_add.py as follows:

# ...
elif self.option("rx-channel-number"):

            for ch in rx_device.rx_channels.values():
                print('Considering', ch.number, type(ch.number), type(self.option('rx-channel-number')), ch.number == self.option('rx-channel-number'))
# ...

resulting in:

$ netaudio subscription add --tx-device-name StreamPC --tx-channel-name Right --rx-device-name VisualsPC --rx-channel-number 1
Considering 1 <class 'int'> <class 'str'> False
Considering 2 <class 'int'> <class 'str'> False
Considering 3 <class 'int'> <class 'str'> False
Considering 4 <class 'int'> <class 'str'> False
Considering 5 <class 'int'> <class 'str'> False
Considering 6 <class 'int'> <class 'str'> False
Considering 7 <class 'int'> <class 'str'> False
Considering 8 <class 'int'> <class 'str'> False
Considering 9 <class 'int'> <class 'str'> False
Considering 10 <class 'int'> <class 'str'> False
Considering 11 <class 'int'> <class 'str'> False
Considering 12 <class 'int'> <class 'str'> False
Considering 13 <class 'int'> <class 'str'> False
Considering 14 <class 'int'> <class 'str'> False
Considering 15 <class 'int'> <class 'str'> False
Considering 16 <class 'int'> <class 'str'> False

In case it makes a difference, this is on both Python 3.8 and 3.9, using v0.0.10 of netaudio.

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

1 participant