Skip to content

Commit 9f120e9

Browse files
Merge pull request #132 from k-toumura/wot-202203-update
Add MQTT binding support for WoT Thing Description
2 parents db319eb + da7669c commit 9f120e9

File tree

6 files changed

+1426
-1122
lines changed

6 files changed

+1426
-1122
lines changed

lib/webofthings/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ module.exports = async function(data, options) {
3737
console.info(`Schema validation succeeded.`);
3838
}
3939

40+
// if there is no title but titles, put one of titles to title.
41+
if (!td.title) {
42+
if (td.titles) {
43+
if (td.titles.en) {
44+
td.title = td.titles.en
45+
} else {
46+
td.title = Object.values(td.titles)[0];
47+
}
48+
} else {
49+
td.title = "notitle";
50+
}
51+
}
52+
4053
// if name is not specified, use td.title for module name.
4154
if (!data.name || data.name === '') {
4255
// filtering out special characters

0 commit comments

Comments
 (0)