Output the contents of the WVA event stream

This command shows the data being received from the WVA event stream based on
the subscriptions that have been set up and the data on the WVA vehicle bus.

\b
    $ wva subscriptions listen
    {'data': {'VehicleSpeed': {'timestamp': '2015-03-25T00:11:53Z',
                                 'value': 198.272461},
               'sequence': 124,
               'short_name': 'speed',
               'timestamp': '2015-03-25T00:11:53Z',
               'uri': 'vehicle/data/VehicleSpeed'}}
    {'data': {'EngineSpeed': {'timestamp': '2015-03-25T00:11:54Z',
                                'value': 6425.5},
               'sequence': 274,
               'short_name': 'rpm',
               'timestamp': '2015-03-25T00:11:54Z',
               'uri': 'vehicle/data/EngineSpeed'}}
    ...
    ^C
    Aborted!

This command can be useful for debugging subscriptions or getting a quick
glimpse at what data is coming in to a WVA device.

def listen(ctx):
    """Output the contents of the WVA event stream

This command shows the data being received from the WVA event stream based on
the subscriptions that have been set up and the data on the WVA vehicle bus.

\b
    $ wva subscriptions listen
    {'data': {'VehicleSpeed': {'timestamp': '2015-03-25T00:11:53Z',
                                 'value': 198.272461},
               'sequence': 124,
               'short_name': 'speed',
               'timestamp': '2015-03-25T00:11:53Z',
               'uri': 'vehicle/data/VehicleSpeed'}}
    {'data': {'EngineSpeed': {'timestamp': '2015-03-25T00:11:54Z',
                                'value': 6425.5},
               'sequence': 274,
               'short_name': 'rpm',
               'timestamp': '2015-03-25T00:11:54Z',
               'uri': 'vehicle/data/EngineSpeed'}}
    ...
    ^C
    Aborted!

This command can be useful for debugging subscriptions or getting a quick
glimpse at what data is coming in to a WVA device.
"""
    wva = get_wva(ctx)
    es = wva.get_event_stream()

    def cb(event):
        cli_pprint(event)

    es.add_event_listener(cb)
    es.enable()
    while True:
        time.sleep(5)