BooleanSubscriber

class ntcore.BooleanSubscriber

Bases: Subscriber

NetworkTables Boolean subscriber.

close() None

Destroys the subscriber

get(*args, **kwargs)

Overloaded function.

  1. get(self: ntcore._ntcore.BooleanSubscriber) -> bool

Get the last published value. If no value has been published, returns the stored default value.

Returns:

value

  1. get(self: ntcore._ntcore.BooleanSubscriber, defaultValue: bool) -> bool

Get the last published value. If no value has been published, returns the passed defaultValue.

Parameters:

defaultValue – default value to return if no value has been published

Returns:

value

getAtomic(*args, **kwargs)

Overloaded function.

  1. getAtomic(self: ntcore._ntcore.BooleanSubscriber) -> ntcore._ntcore.TimestampedBoolean

Get the last published value along with its timestamp If no value has been published, returns the stored default value and a timestamp of 0.

Returns:

timestamped value

  1. getAtomic(self: ntcore._ntcore.BooleanSubscriber, defaultValue: bool) -> ntcore._ntcore.TimestampedBoolean

Get the last published value along with its timestamp. If no value has been published, returns the passed defaultValue and a timestamp of 0.

Parameters:

defaultValue – default value to return if no value has been published

Returns:

timestamped value

getTopic() ntcore._ntcore.BooleanTopic

Get the corresponding topic.

Returns:

Topic

readQueue() List[ntcore._ntcore.TimestampedBoolean]

Get an array of all value changes since the last call to ReadQueue. Also provides a timestamp for each value.

@note The “poll storage” subscribe option can be used to set the queue depth.

Returns:

Array of timestamped values; empty array if no new changes have been published since the previous call.