|
1 | 1 | import {
|
2 | 2 | prepareAttributesDefinitions,
|
3 |
| - string_attribute, |
| 3 | + string_collection_attribute_writable, |
4 | 4 | url_attribute,
|
5 |
| - boolean_attribute, |
| 5 | + boolean_attribute_writable_false, |
6 | 6 | username_attribute,
|
7 | 7 | password_attribute,
|
8 | 8 | timeout_attribute,
|
9 |
| - integer_attribute |
| 9 | + integer_attribute_writable |
10 | 10 | } from "pacc";
|
11 | 11 | import { Service } from "@kronos-integration/service";
|
12 | 12 | import { connect } from "mqtt";
|
@@ -37,16 +37,16 @@ export class ServiceMQTT extends Service {
|
37 | 37 | needsRestart: true
|
38 | 38 | },
|
39 | 39 | keepalive: {
|
40 |
| - ...integer_attribute, |
| 40 | + ...integer_attribute_writable, |
41 | 41 | default: 60,
|
42 | 42 | isConnectionOption: true
|
43 | 43 | },
|
44 |
| - clean: { ...boolean_attribute, isConnectionOption: true }, |
45 |
| - clientId: { ...string_attribute, isConnectionOption: true }, |
| 44 | + clean: { ...boolean_attribute_writable_false, isConnectionOption: true }, |
| 45 | + clientId: { ...string_collection_attribute_writable, isConnectionOption: true }, |
46 | 46 | connectTimeout: { ...timeout_attribute, isConnectionOption: true },
|
47 | 47 | reconnectPeriod: {
|
48 |
| - ...integer_attribute, |
49 |
| - isConnectionOption: true, |
| 48 | + ...integer_attribute_writable, |
| 49 | + isConnectionOption: true |
50 | 50 | },
|
51 | 51 | username: username_attribute,
|
52 | 52 | password: password_attribute
|
@@ -112,8 +112,7 @@ export class ServiceMQTT extends Service {
|
112 | 112 | const ep = this.endpoints[topic];
|
113 | 113 | if (ep) {
|
114 | 114 | ep.send(message);
|
115 |
| - } |
116 |
| - else { |
| 115 | + } else { |
117 | 116 | this.error(`no endpoint for topic ${topic}`);
|
118 | 117 | }
|
119 | 118 | });
|
|
0 commit comments