Shows how to interact with a parameter subscription.

def manage_subscription():
    """Shows how to interact with a parameter subscription."""
    subscription = processor.create_parameter_subscription([
        '/YSS/SIMULATOR/BatteryVoltage1'
    ])

    sleep(5)

    print('Adding extra items to the existing subscription...')
    subscription.add([
        '/YSS/SIMULATOR/Alpha',
        '/YSS/SIMULATOR/BatteryVoltage2',
        'MDB:OPS Name/SIMULATOR_PrimBusVoltage1',
    ])

    sleep(5)

    print('Shrinking subscription...')
    subscription.remove('/YSS/SIMULATOR/Alpha')

    print('Cancelling the subscription...')
    subscription.cancel()

    print('Last values from cache:')
    print(subscription.get_value('/YSS/SIMULATOR/BatteryVoltage1'))
    print(subscription.get_value('/YSS/SIMULATOR/BatteryVoltage2'))
    print(subscription.get_value('/YSS/SIMULATOR/Alpha'))
    print(subscription.get_value('MDB:OPS Name/SIMULATOR_PrimBusVoltage1'))