GenericPublisher

class ntcore.GenericPublisher

Bases: Publisher

NetworkTables generic publisher.

get_topic() ntcore._ntcore.Topic

Get the corresponding topic.

Returns:

Topic

set(value: ntcore._ntcore.Value) None

Publish a new value.

Parameters:

value – value to publish

set_boolean(value: bool, time: SupportsInt | SupportsIndex = 0) bool

Sets the entry’s value.

Parameters:
  • value – the value to set

  • time – the timestamp to set (0 = wpi::nt::Now())

Returns:

False if the entry exists with a different type

set_boolean_array(*args, **kwargs)

Overloaded function.

  1. set_boolean_array(self: ntcore._ntcore.GenericPublisher, value: List[bool], time: typing.SupportsInt | typing.SupportsIndex = 0) -> bool

Sets the entry’s value.

Parameters:
  • value – the value to set

  • time – the timestamp to set (0 = wpi::nt::Now())

Returns:

False if the entry exists with a different type

  1. set_boolean_array(self: ntcore._ntcore.GenericPublisher, value: List[typing.SupportsInt | typing.SupportsIndex], time: typing.SupportsInt | typing.SupportsIndex = 0) -> bool

Sets the entry’s value.

Parameters:
  • value – the value to set

  • time – the timestamp to set (0 = wpi::nt::Now())

Returns:

False if the entry exists with a different type

set_default(value: ntcore._ntcore.Value) None

Publish a default value. On reconnect, a default value will never be used in preference to a published value.

Parameters:

value – value

set_default_boolean(default_value: bool) bool

Sets the entry’s value if it does not exist.

Parameters:

default_value – the default value to set

Returns:

True if the entry did not already have a value, otherwise False

set_default_boolean_array(default_value: List[SupportsInt | SupportsIndex]) bool

Sets the entry’s value if it does not exist.

Parameters:

default_value – the default value to set

Returns:

True if the entry did not already have a value, otherwise False

set_default_double(default_value: SupportsFloat | SupportsIndex) bool

Sets the entry’s value if it does not exist.

Parameters:

default_value – the default value to set

Returns:

True if the entry did not already have a value, otherwise False

set_default_double_array(default_value: List[SupportsFloat | SupportsIndex]) bool

Sets the entry’s value if it does not exist.

Parameters:

default_value – the default value to set

Returns:

True if the entry did not already have a value, otherwise False

set_default_float(default_value: SupportsFloat | SupportsIndex) bool

Sets the entry’s value if it does not exist.

Parameters:

default_value – the default value to set

Returns:

True if the entry did not already have a value, otherwise False

set_default_float_array(default_value: List[SupportsFloat | SupportsIndex]) bool

Sets the entry’s value if it does not exist.

Parameters:

default_value – the default value to set

Returns:

True if the entry did not already have a value, otherwise False

set_default_integer(default_value: SupportsInt | SupportsIndex) bool

Sets the entry’s value if it does not exist.

Parameters:

default_value – the default value to set

Returns:

True if the entry did not already have a value, otherwise False

set_default_integer_array(default_value: List[SupportsInt | SupportsIndex]) bool

Sets the entry’s value if it does not exist.

Parameters:

default_value – the default value to set

Returns:

True if the entry did not already have a value, otherwise False

set_default_raw(default_value: Buffer) bool

Sets the entry’s value if it does not exist.

Parameters:

default_value – the default value to set

Returns:

True if the entry did not already have a value, otherwise False

set_default_string(default_value: str) bool

Sets the entry’s value if it does not exist.

Parameters:

default_value – the default value to set

Returns:

True if the entry did not already have a value, otherwise False

set_default_string_array(default_value: List[str]) bool

Sets the entry’s value if it does not exist.

Parameters:

default_value – the default value to set

Returns:

True if the entry did not already have a value, otherwise False

set_double(value: SupportsFloat | SupportsIndex, time: SupportsInt | SupportsIndex = 0) bool

Sets the entry’s value.

Parameters:
  • value – the value to set

  • time – the timestamp to set (0 = wpi::nt::Now())

Returns:

False if the entry exists with a different type

set_double_array(value: List[SupportsFloat | SupportsIndex], time: SupportsInt | SupportsIndex = 0) bool

Sets the entry’s value.

Parameters:
  • value – the value to set

  • time – the timestamp to set (0 = wpi::nt::Now())

Returns:

False if the entry exists with a different type

set_float(value: SupportsFloat | SupportsIndex, time: SupportsInt | SupportsIndex = 0) bool

Sets the entry’s value.

Parameters:
  • value – the value to set

  • time – the timestamp to set (0 = wpi::nt::Now())

Returns:

False if the entry exists with a different type

set_float_array(value: List[SupportsFloat | SupportsIndex], time: SupportsInt | SupportsIndex = 0) bool

Sets the entry’s value.

Parameters:
  • value – the value to set

  • time – the timestamp to set (0 = wpi::nt::Now())

Returns:

False if the entry exists with a different type

set_integer(value: SupportsInt | SupportsIndex, time: SupportsInt | SupportsIndex = 0) bool

Sets the entry’s value.

Parameters:
  • value – the value to set

  • time – the timestamp to set (0 = wpi::nt::Now())

Returns:

False if the entry exists with a different type

set_integer_array(value: List[SupportsInt | SupportsIndex], time: SupportsInt | SupportsIndex = 0) bool

Sets the entry’s value.

Parameters:
  • value – the value to set

  • time – the timestamp to set (0 = wpi::nt::Now())

Returns:

False if the entry exists with a different type

set_raw(value: Buffer, time: SupportsInt | SupportsIndex = 0) bool

Sets the entry’s value.

Parameters:
  • value – the value to set

  • time – the timestamp to set (0 = wpi::nt::Now())

Returns:

False if the entry exists with a different type

set_string(value: str, time: SupportsInt | SupportsIndex = 0) bool

Sets the entry’s value.

Parameters:
  • value – the value to set

  • time – the timestamp to set (0 = wpi::nt::Now())

Returns:

False if the entry exists with a different type

set_string_array(value: List[str], time: SupportsInt | SupportsIndex = 0) bool

Sets the entry’s value.

Parameters:
  • value – the value to set

  • time – the timestamp to set (0 = wpi::nt::Now())

Returns:

False if the entry exists with a different type