Closed amorygalili closed 5 years ago
I think you can already do this with NetworkTables.getEntry(name).getType()
Anyways, for pynetworktables2js, what you really want is the underlying value/entry to be passed to you (since the caller already has it), instead of dereferencing it. Maybe add another flag to the entry listener instead, that passes the callback the value (which has the type available) instead.
Actually, it looks like it's already there, if you don't specify paramIsNew
: https://github.com/robotpy/pynetworktables/blob/59b5d1328274e78393202fe2a7e09845f5ff63a5/networktables/networktable.py#L170
... which, that's actually a bug. Probably should be documented.
… with a key. Using pynetworktables2js I'm not able to tell what type an empty array is (whether it's a string, bool, or number array), so I want to send the type of the variable along with its value and key through the websocket.