@momo2555/koppeliajs 0.0.140 → 0.0.142

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.
@@ -83,4 +83,9 @@ export declare class Koppelia {
83
83
  * text update notification form koppelia application
84
84
  */
85
85
  registerNewResizableText(id: string, defaultSize: number, onTextResized: (newSize: number) => void): Promise<void>;
86
+ /**
87
+ *
88
+ * @param sentence
89
+ */
90
+ say(sentence: string): void;
86
91
  }
@@ -265,4 +265,17 @@ export class Koppelia {
265
265
  resolve();
266
266
  });
267
267
  }
268
+ /**
269
+ *
270
+ * @param sentence
271
+ */
272
+ say(sentence) {
273
+ // create the message to request the devices
274
+ let sayRequest = new Message();
275
+ sayRequest.setRequest("sayRequest");
276
+ sayRequest.addParam("sentence", sentence);
277
+ sayRequest.setDestination(PeerType.MAESTRO, "");
278
+ // send the message to the console
279
+ this._console.sendMessage(sayRequest);
280
+ }
268
281
  }
@@ -2,6 +2,7 @@ export type AnyRequest = {
2
2
  [key: string]: any;
3
3
  };
4
4
  export declare enum PeerType {
5
+ MAESTRO = "maestro",
5
6
  MONITOR = "monitor",
6
7
  MASTER = "master",
7
8
  CONTROLLER = "controller",
@@ -1,6 +1,7 @@
1
1
  import { v4 as uuidv4 } from 'uuid';
2
2
  export var PeerType;
3
3
  (function (PeerType) {
4
+ PeerType["MAESTRO"] = "maestro";
4
5
  PeerType["MONITOR"] = "monitor";
5
6
  PeerType["MASTER"] = "master";
6
7
  PeerType["CONTROLLER"] = "controller";
@@ -15,14 +15,14 @@ export class Play {
15
15
  constructor(console, playId, playRawObj) {
16
16
  this._console = console;
17
17
  this._playId = playId;
18
- if (playRawObj.play_name !== undefined) {
19
- this._playName = playRawObj.play_name;
18
+ if (playRawObj.name !== undefined) {
19
+ this._playName = playRawObj.name;
20
20
  }
21
- if (playRawObj.play_game_id !== undefined) {
22
- this._playGameId = playRawObj.play_game_id;
21
+ if (playRawObj.game_id !== undefined) {
22
+ this._playGameId = playRawObj.game_id;
23
23
  }
24
- if (playRawObj.play_file_name !== undefined) {
25
- this._playFileName = playRawObj.play_file_name;
24
+ if (playRawObj.file_name !== undefined) {
25
+ this._playFileName = playRawObj.file_name;
26
26
  }
27
27
  }
28
28
  getPlayMediaPath(mediaName) {
@@ -18,9 +18,9 @@ export class Resident {
18
18
  return koppelia.getMediaLink(path);
19
19
  }
20
20
  fromObject(object) {
21
- this._name = object["resident_name"];
22
- this._id = object["resident_id"];
23
- this._image = object["resident_image"];
24
- this._residenceId = object["resident_residence_id"];
21
+ this._name = object["name"];
22
+ this._id = object["id"];
23
+ this._image = object["image"];
24
+ this._residenceId = object["residence_id"];
25
25
  }
26
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo2555/koppeliajs",
3
- "version": "0.0.140",
3
+ "version": "0.0.142",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",