@iobroker/socket-classes 1.1.4 → 1.1.5

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.
package/README.md CHANGED
@@ -888,7 +888,7 @@ Read all instances of the given adapter, or all instances of all adapters if ada
888
888
  -->
889
889
 
890
890
  ## Changelog
891
- ### 1.1.4 (2023-03-13)
891
+ ### 1.1.5 (2023-03-13)
892
892
  * (bluefox) Added command `name`
893
893
 
894
894
  ### 1.1.3 (2023-03-12)
@@ -271,11 +271,9 @@ class SocketCommon {
271
271
 
272
272
  this._updateConnectedInfo();
273
273
 
274
- const commands = this.commands.getCommandHandler();
275
-
276
- if (!commands['name']) {
274
+ if (!this.commands.getCommandHandler('name')) {
277
275
  // socket sends its name => update list of sockets
278
- commands['name'] = (_socket, name, cb) => {
276
+ this.addCommandHandler('name', (_socket, name, cb) => {
279
277
  this.adapter.log.debug(`Connection from "${name}"`);
280
278
  if (_socket._name === undefined) {
281
279
  _socket._name = name;
@@ -287,7 +285,7 @@ class SocketCommon {
287
285
  }
288
286
 
289
287
  typeof cb === 'function' && cb();
290
- };
288
+ });
291
289
  }
292
290
 
293
291
  this.commands.applyCommands(socket);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/socket-classes",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "ioBroker server-side web sockets",
5
5
  "author": {
6
6
  "name": "bluefox",