- Add shared
unittesthelpers for mocking X-Plane REST/WebSocket responses - Fill remaining coverage gaps for
Dataref,Command,Cache,XPRestAPI,XPWebsocketAPI,XPUDPAPI,XPBeaconMonitor - Keep
uv run python -m unittest discover -vas the test workflow
-
API.dataref_valuereturnsDatarefReadResultwith scalar, array, bytes, andNonesupport - Standardize write/execute return types with
APIResultacross the abstract base and overrides - Verify override compatibility with the type checker
-
XPWebAPIError(Exception)as base -
XPConnectionError,XPTimeoutError,XPVersionError,XPBeaconError - Replace bare
raise XPlaneNoBeacon()/raise XPlaneTimeoutwith typed exceptions carrying context
- Add
AsyncXPRestAPI(or async mixin) usinghttpx.AsyncClient - Async variants of
dataref_value,write_dataref,execute_command - Keep sync API as default; async is opt-in
- Replace
Cache.meta()union return (DatarefMeta | CommandMeta) with two typed classes - Eliminates
isinstancechecks inrest.pyandws.py - Fix
get_dataref_meta_*/get_command_meta_*to return precise types from the cache layer
-
with xpwebapi.ws_api() as api:for automatic connect/disconnect -
__enter__/__exit__onXPRestAPI,XPWebsocketAPI,XPUDPAPI - Ensure socket/thread cleanup on exit
- Replace
class API(ABC)with aProtocolfor structural subtyping - Removes need for abstract method stubs that return
False
- Replace
List,Dict,Tuplefromtypingwith built-inlist,dict,tuple - Replace
Optional[X]withX | None - Use
Selffromtypingwhere appropriate
- Add JSON log formatter option
- Separate request/response traffic logging from application logging
- Configurable log levels per component via JSON configuration
- Evaluate
websocketsas replacement forsimple-websocket - Better async support, more active maintenance
- Benchmark and migrate if beneficial
- GitHub Actions: lint (
ruff check), format (ruff format --check), type check (ty check), test (python -m unittest discover -v), and package build validation (uv build) - Publish version 4.0.0 to PyPI from the tagged release workflow
- Pre-commit hooks for local development
- Preserve MkDocs deployment on pushes to
main
- Type-annotate all examples
- Add usage patterns (connection lifecycle, monitoring datarefs, executing commands)
- Generate and publish API docs via
mkdocstrings
- WebSocket API supports bulk subscribe/unsubscribe
- Add
monitor_datarefs()batch helper with single round-trip - Document performance characteristics
- Reuse
httpx.ClientacrossXPRestAPIinstances when possible - Pool configuration options (max connections, timeouts)