photonlibpy: Fix some type check failures (#1548)

This fixes a variety of type check failures raised by both mypy and pyright. See #1548
This commit is contained in:
David Vo
2024-11-12 16:53:43 +11:00
committed by GitHub
parent 31ec9baa95
commit af03ae0a8b
6 changed files with 40 additions and 17 deletions

View File

@@ -233,12 +233,13 @@ class PhotonCamera:
remoteUUID = self._rawBytesEntry.getTopic().getProperty("message_uuid")
if remoteUUID is None or len(remoteUUID) == 0:
if not remoteUUID:
wpilib.reportWarning(
f"PhotonVision coprocessor at path {self._path} has not reported a message interface UUID - is your coprocessor's camera started?",
True,
)
assert isinstance(remoteUUID, str)
# ntcore hands us a JSON string with leading/trailing quotes - remove those
remoteUUID = remoteUUID.replace('"', "")