@momo2555/koppeliajs 0.0.164 → 0.0.166

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,7 @@ export declare class Device {
24
24
  constructor(console: Console, address?: string);
25
25
  get color(): Color;
26
26
  get name(): string;
27
+ get address(): string;
27
28
  /**
28
29
  * Subscribes to a specific hardware event for this device.
29
30
  * @param eventName The name of the event to listen to.
@@ -31,6 +31,9 @@ export class Device {
31
31
  get name() {
32
32
  return this._name;
33
33
  }
34
+ get address() {
35
+ return this._address;
36
+ }
34
37
  /**
35
38
  * Subscribes to a specific hardware event for this device.
36
39
  * @param eventName The name of the event to listen to.
@@ -80,7 +80,7 @@ export class KoppeliaWebsocket {
80
80
  }
81
81
  let message = new Message();
82
82
  message.parse(data);
83
- if (message.getRequestId() !== undefined) {
83
+ if (message.getRequestId() !== undefined && message.getType() == "response") {
84
84
  let onGoing = this._getOnGoingRequest(message.getRequestId());
85
85
  if (onGoing) {
86
86
  if (onGoing.callback)
@@ -85,6 +85,7 @@ export declare class Message {
85
85
  * @param type The MessageType to assign.
86
86
  */
87
87
  setType(type: MessageType): void;
88
+ getType(): string;
88
89
  /**
89
90
  * Configures the message as an event request.
90
91
  * @param event The name of the event.
@@ -121,6 +121,9 @@ export class Message {
121
121
  setType(type) {
122
122
  this.header.type = type;
123
123
  }
124
+ getType() {
125
+ return this.header.type;
126
+ }
124
127
  /**
125
128
  * Configures the message as an event request.
126
129
  * @param event The name of the event.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo2555/koppeliajs",
3
- "version": "0.0.164",
3
+ "version": "0.0.166",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",