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

device() errors when path is udp://*:29998 #29

Open
woodbri opened this issue Oct 30, 2021 · 0 comments
Open

device() errors when path is udp://*:29998 #29

woodbri opened this issue Oct 30, 2021 · 0 comments

Comments

@woodbri
Copy link

woodbri commented Oct 30, 2021

When the device is not a serial device gpsd.device() fails as "speed" and "driver" are not in the dict.
Made the following changes:

def device():
    """ Get information about current gps device
    :return: dict
    """
    global state

    speed = ''
    if 'bps' in state['devices']['devices'][0].keys():
        speed = state['devices']['devices'][0]['bps']

    driver = ''
    if 'driver' in state['devices']['devices'][0].keys():
        driver = state['devices']['devices'][0]['driver']

    return {
        'path': state['devices']['devices'][0]['path'],
        'speed': speed,
        'driver': driver
    }

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