Skip to content

Commit 7e7f275

Browse files
committed
fix: update common attributes
1 parent fd90bef commit 7e7f275

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/service-mqtt.mjs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import {
22
prepareAttributesDefinitions,
3-
string_attribute,
3+
string_collection_attribute_writable,
44
url_attribute,
5-
boolean_attribute,
5+
boolean_attribute_writable_false,
66
username_attribute,
77
password_attribute,
88
timeout_attribute,
9-
integer_attribute
9+
integer_attribute_writable
1010
} from "pacc";
1111
import { Service } from "@kronos-integration/service";
1212
import { connect } from "mqtt";
@@ -37,16 +37,16 @@ export class ServiceMQTT extends Service {
3737
needsRestart: true
3838
},
3939
keepalive: {
40-
...integer_attribute,
40+
...integer_attribute_writable,
4141
default: 60,
4242
isConnectionOption: true
4343
},
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 },
4646
connectTimeout: { ...timeout_attribute, isConnectionOption: true },
4747
reconnectPeriod: {
48-
...integer_attribute,
49-
isConnectionOption: true,
48+
...integer_attribute_writable,
49+
isConnectionOption: true
5050
},
5151
username: username_attribute,
5252
password: password_attribute
@@ -112,8 +112,7 @@ export class ServiceMQTT extends Service {
112112
const ep = this.endpoints[topic];
113113
if (ep) {
114114
ep.send(message);
115-
}
116-
else {
115+
} else {
117116
this.error(`no endpoint for topic ${topic}`);
118117
}
119118
});

0 commit comments

Comments
 (0)