Skip to content

Commit bd67c4a

Browse files
authored
Wrong imports
1 parent 0c4505d commit bd67c4a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

docs/usage/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Usage of REST API
55

66
```python
7-
import xpwebapi, CALLBACK_TYPE
7+
import xpwebapi
88
99
# REST API
1010
api = xpwebapi.rest_api(host="192.168.1.140", port=8080, api_version="v2") # defaults: host="127.0.0.1", port=8086, api="/api", use_cache=False
@@ -26,18 +26,18 @@ mapview.execute()
2626
## Usage of Websocket API
2727

2828
```python
29-
import xpwebapi
29+
from xpwebapi import ws_api, CALLBACK_TYPE
3030
31-
ws = xpwebapi.ws_api(host="192.168.1.140", port=8080) # defaults to v2 for Websocket
31+
ws = ws_api(host="192.168.1.140", port=8080) # defaults to v2 for Websocket
3232
3333
def dataref_monitor(dataref: str, value: Any):
3434
print(f"dataref updated: {dataref}={value}")
3535
3636
def command_active_monitor(command: str, active: bool):
3737
print(f"command activated: {command}={active}")
3838
39-
ws.add_callback(cbtype=CALLBACK_TYPE.DATAREF_UPDATE, CALLBACK=dataref_monitor)
40-
ws.add_callback(cbtype=CALLBACK_TYPE.COMMAND_ACTIVE, CALLBACK=command_active_monitor)
39+
ws.add_callback(cbtype=CALLBACK_TYPE.DATAREF_UPDATE, callback=dataref_monitor)
40+
ws.add_callback(cbtype=CALLBACK_TYPE.COMMAND_ACTIVE, callback=command_active_monitor)
4141
4242
ws.connect()
4343
ws.wait_connection() # blocks until X-Plane is reachable

0 commit comments

Comments
 (0)