incyclist-devices 1.5.37 → 1.5.38

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.
@@ -34,13 +34,19 @@ const DEBUG_LOGGER = {
34
34
  log: (e, ...args) => console.log(e, ...args),
35
35
  logEvent: (event) => console.log(JSON.stringify(event))
36
36
  };
37
+ const validateHost = (host) => {
38
+ const ipParts = host.split('.');
39
+ if (ipParts.length > 1)
40
+ return ipParts.map(p => Number(p)).join('.');
41
+ return host;
42
+ };
37
43
  class Daum8i {
38
44
  constructor(props) {
39
45
  this.props = props || {};
40
46
  this.logger = process.env.DEBUG ? DEBUG_LOGGER : new gd_eventlog_1.EventLogger('DaumPremium');
41
47
  if (this.props.interface === 'tcpip') {
42
48
  const port = this.props.port || DAUM_PREMIUM_DEFAULT_PORT;
43
- const host = this.props.host || DAUM_PREMIUM_DEFAULT_HOST;
49
+ const host = validateHost(this.props.host || DAUM_PREMIUM_DEFAULT_HOST);
44
50
  this.portName = `${host}:51955`;
45
51
  this.tcpip = true;
46
52
  this.serial = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "1.5.37",
3
+ "version": "1.5.38",
4
4
  "dependencies": {
5
5
  "@serialport/parser-byte-length": "^9.0.1",
6
6
  "@serialport/parser-delimiter": "^9.0.1",