iobroker.iot 3.5.2 → 4.0.1

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.
Files changed (111) hide show
  1. package/README.md +24 -9
  2. package/admin/assets/index-Y479CE6x.js +681 -0
  3. package/admin/index_m.html +1 -1
  4. package/admin/rules/assets/{ActionVisu-D9x2f6zu.js → ActionVisu-DE8dgNVF.js} +1 -1
  5. package/admin/rules/assets/{ActionVisu__loadShare__react__loadShare__-Cg21Ef1U.js → ActionVisu__loadShare__react__loadShare__-BKaC-p5K.js} +1 -1
  6. package/admin/rules/assets/{ActionVisu__loadShare__react_mf_2_dom__loadShare__-B1zRWn0u.js → ActionVisu__loadShare__react_mf_2_dom__loadShare__-Bs1o8DtQ.js} +2 -2
  7. package/admin/rules/assets/ActionVisu__mf_v__runtimeInit__mf_v__-DtUoI3FU.js +5 -0
  8. package/admin/rules/assets/bootstrap-Ba57tu25.js +1 -0
  9. package/admin/rules/assets/hostInit-hos3Txsy.js +1 -1
  10. package/admin/rules/assets/{index-Duo7mFlZ.js → index-CbxmbJvB.js} +2 -2
  11. package/admin/rules/assets/{index-CAAeiKCc.js → index-DjPMvPni.js} +2 -2
  12. package/admin/rules/assets/index-_Y2FN5EZ.js +1152 -0
  13. package/admin/rules/assets/{virtualExposes-BqVak7rX.js → virtualExposes-BNZJTatg.js} +2 -2
  14. package/admin/rules/customRuleBlocks.js +2 -2
  15. package/io-package.json +27 -27
  16. package/package.json +17 -14
  17. package/admin/assets/index-Df2NS929.js +0 -681
  18. package/admin/rules/assets/ActionVisu__mf_v__runtimeInit__mf_v__-Cz053nO7.js +0 -10
  19. package/admin/rules/assets/bootstrap-BCFKIiwZ.js +0 -1
  20. package/admin/rules/assets/index-BwcOGyWI.js +0 -1152
  21. package/lib/AlexaSmartHomeV3/Alexa/AlexaResponse.js +0 -262
  22. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/Base.js +0 -124
  23. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/BrightnessController.js +0 -15
  24. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorController.js +0 -10
  25. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorTemperatureController.js +0 -15
  26. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/ContactSensor.js +0 -10
  27. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/LockController.js +0 -10
  28. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/ModeController.js +0 -69
  29. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/MotionSensor.js +0 -10
  30. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/PercentageController.js +0 -10
  31. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/PowerController.js +0 -15
  32. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/Speaker.js +0 -20
  33. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/TemperatureSensor.js +0 -10
  34. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/ThermostatController.js +0 -34
  35. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/index.js +0 -14
  36. package/lib/AlexaSmartHomeV3/Alexa/Directives/Base.js +0 -27
  37. package/lib/AlexaSmartHomeV3/Alexa/Directives/ChangeReport.js +0 -75
  38. package/lib/AlexaSmartHomeV3/Alexa/Directives/Discovery.js +0 -39
  39. package/lib/AlexaSmartHomeV3/Alexa/Directives/ReportState.js +0 -50
  40. package/lib/AlexaSmartHomeV3/Alexa/Directives/index.js +0 -13
  41. package/lib/AlexaSmartHomeV3/Alexa/ModeValues/Base.js +0 -38
  42. package/lib/AlexaSmartHomeV3/Alexa/ModeValues/Closed.js +0 -55
  43. package/lib/AlexaSmartHomeV3/Alexa/ModeValues/Open.js +0 -56
  44. package/lib/AlexaSmartHomeV3/Alexa/ModeValues/index.js +0 -14
  45. package/lib/AlexaSmartHomeV3/Alexa/Properties/AdjustableProperty.js +0 -11
  46. package/lib/AlexaSmartHomeV3/Alexa/Properties/Base.js +0 -108
  47. package/lib/AlexaSmartHomeV3/Alexa/Properties/Brightness.js +0 -14
  48. package/lib/AlexaSmartHomeV3/Alexa/Properties/Color.js +0 -40
  49. package/lib/AlexaSmartHomeV3/Alexa/Properties/ColorTemperatureInKelvin.js +0 -62
  50. package/lib/AlexaSmartHomeV3/Alexa/Properties/DetectionState.js +0 -22
  51. package/lib/AlexaSmartHomeV3/Alexa/Properties/LockState.js +0 -40
  52. package/lib/AlexaSmartHomeV3/Alexa/Properties/Mode.js +0 -32
  53. package/lib/AlexaSmartHomeV3/Alexa/Properties/Muted.js +0 -17
  54. package/lib/AlexaSmartHomeV3/Alexa/Properties/Percentage.js +0 -14
  55. package/lib/AlexaSmartHomeV3/Alexa/Properties/PowerState.js +0 -25
  56. package/lib/AlexaSmartHomeV3/Alexa/Properties/TargetSetpoint.js +0 -28
  57. package/lib/AlexaSmartHomeV3/Alexa/Properties/Temperature.js +0 -20
  58. package/lib/AlexaSmartHomeV3/Alexa/Properties/ThermostatMode.js +0 -52
  59. package/lib/AlexaSmartHomeV3/Alexa/Properties/Volume.js +0 -19
  60. package/lib/AlexaSmartHomeV3/Alexa/Properties/index.js +0 -14
  61. package/lib/AlexaSmartHomeV3/Controls/AdjustableControl.js +0 -22
  62. package/lib/AlexaSmartHomeV3/Controls/AdjustablePercentageControl.js +0 -28
  63. package/lib/AlexaSmartHomeV3/Controls/AirCondition.js +0 -144
  64. package/lib/AlexaSmartHomeV3/Controls/Blind.js +0 -12
  65. package/lib/AlexaSmartHomeV3/Controls/ContactSensor.js +0 -17
  66. package/lib/AlexaSmartHomeV3/Controls/Control.js +0 -352
  67. package/lib/AlexaSmartHomeV3/Controls/Ct.js +0 -172
  68. package/lib/AlexaSmartHomeV3/Controls/Dimmer.js +0 -124
  69. package/lib/AlexaSmartHomeV3/Controls/Door.js +0 -9
  70. package/lib/AlexaSmartHomeV3/Controls/Gate.js +0 -42
  71. package/lib/AlexaSmartHomeV3/Controls/Hue.js +0 -207
  72. package/lib/AlexaSmartHomeV3/Controls/Light.js +0 -54
  73. package/lib/AlexaSmartHomeV3/Controls/Lock.js +0 -36
  74. package/lib/AlexaSmartHomeV3/Controls/Motion.js +0 -17
  75. package/lib/AlexaSmartHomeV3/Controls/ReadOnlyDetector.js +0 -25
  76. package/lib/AlexaSmartHomeV3/Controls/Slider.js +0 -10
  77. package/lib/AlexaSmartHomeV3/Controls/Socket.js +0 -21
  78. package/lib/AlexaSmartHomeV3/Controls/Temperature.js +0 -22
  79. package/lib/AlexaSmartHomeV3/Controls/Thermostat.js +0 -86
  80. package/lib/AlexaSmartHomeV3/Controls/VacuumCleaner.js +0 -28
  81. package/lib/AlexaSmartHomeV3/Controls/Volume.js +0 -109
  82. package/lib/AlexaSmartHomeV3/Controls/VolumeGroup.js +0 -9
  83. package/lib/AlexaSmartHomeV3/Controls/Window.js +0 -9
  84. package/lib/AlexaSmartHomeV3/Controls/index.js +0 -14
  85. package/lib/AlexaSmartHomeV3/Device.js +0 -84
  86. package/lib/AlexaSmartHomeV3/DeviceManager.js +0 -415
  87. package/lib/AlexaSmartHomeV3/Exceptions/AlexaV3Exception.js +0 -8
  88. package/lib/AlexaSmartHomeV3/Exceptions/HourlyDeviceRateLimitExceeded.js +0 -5
  89. package/lib/AlexaSmartHomeV3/Exceptions/OverallDailyRateLimitExceeded.js +0 -5
  90. package/lib/AlexaSmartHomeV3/Helpers/AdapterProvider.js +0 -46
  91. package/lib/AlexaSmartHomeV3/Helpers/FileHelper.js +0 -70
  92. package/lib/AlexaSmartHomeV3/Helpers/IotProxy.js +0 -44
  93. package/lib/AlexaSmartHomeV3/Helpers/Logger.js +0 -95
  94. package/lib/AlexaSmartHomeV3/Helpers/RateLimiter.js +0 -82
  95. package/lib/AlexaSmartHomeV3/Helpers/Utils.js +0 -583
  96. package/lib/Utils.js +0 -608
  97. package/lib/adminCommonSocket.js +0 -781
  98. package/lib/alexaCustom.js +0 -622
  99. package/lib/alexaSmartHomeV2.js +0 -2792
  100. package/lib/alexaSmartHomeV3.js +0 -117
  101. package/lib/alisa.js +0 -2412
  102. package/lib/devices.js +0 -20
  103. package/lib/functions.js +0 -21
  104. package/lib/googleHome.js +0 -3323
  105. package/lib/notifications.js +0 -37
  106. package/lib/remote.js +0 -1363
  107. package/lib/rooms.js +0 -45
  108. package/lib/texts.js +0 -79
  109. package/lib/translate.js +0 -19
  110. package/lib/visuApp.js +0 -157
  111. package/main.js +0 -1444
package/lib/rooms.js DELETED
@@ -1,45 +0,0 @@
1
- 'use strict';
2
-
3
- const translate = require('./translate.js');
4
-
5
- const dictionary = [
6
- { en: 'living room/livingroom', it: 'soggiorno/soggiorno', de: 'Wohnzimmer', ru: 'зал' },
7
- {
8
- en: 'bedroom/sleeping room/sleepingroom',
9
- it: 'camera da letto/camera da letto/camera da letto',
10
- de: 'Schlafzimmer',
11
- ru: 'спальня',
12
- },
13
- { en: 'bathroom/bath', it: 'Bagno/bagno', de: 'Bad/Badezimmer', ru: 'ванная' },
14
- { en: 'office', it: 'ufficio', de: 'Arbeitszimmer', ru: 'кабинет' },
15
- { en: 'nursery room/nurseryroom', it: 'stanza dei bambini/stanza dei bambini', de: 'Kinderzimmer', ru: 'детская' },
16
- { en: 'guestwc', it: 'Guestwc', de: 'Gästewc', ru: 'гостевой туалет' },
17
- { en: 'wc', it: 'bagno', de: 'WC', ru: 'туалет' },
18
- { en: 'toilet', it: 'gabinetto', de: 'Toilette', ru: 'туалет' },
19
- { en: 'floor', it: 'pavimento', de: 'Flur/Diele/gang', ru: 'коридор/прихожая' },
20
- { en: 'kitchen', it: 'cucina', de: 'Küche/kueche', ru: 'кухня' },
21
- { en: 'terrace', it: 'terrazza', de: 'Balkon/terrasse', ru: 'терасса/балкон' },
22
- { en: 'dinning room/dinningroom', it: 'sala da pranzo/sala da pranzo', de: 'Esszimmer', ru: 'столовая' },
23
- { en: 'garage', it: 'box auto', de: 'Garage', ru: 'гараж' },
24
- { en: 'stairs', it: 'le scale', de: 'Treppe/treppenhaus', ru: 'лестница' },
25
- { en: 'garden', it: 'giardino', de: 'Garten', ru: 'сад' },
26
- { en: 'court', it: 'Tribunale', de: 'Hof', ru: 'двор' },
27
- { en: 'guest room/guestroom', it: 'camera degli ospiti/camera', de: 'Gästezimmer', ru: 'гостевая' },
28
- { en: 'attic', it: 'Attico', de: 'Speicher', ru: 'кладовка' },
29
- { en: 'roof', it: 'tetto', de: 'Dachstuhl', ru: 'крыша' },
30
- { en: 'terminal', it: 'terminale', de: 'Anschlussraum', ru: 'сени' },
31
- { en: 'washroom', it: 'Toilette', de: 'Waschraum', ru: 'прачечная' },
32
- {
33
- en: 'heating room/heatingroom',
34
- it: 'stanza di riscaldamento/riscaldamento',
35
- de: 'Heizungsraum/Heatingroom',
36
- ru: 'котельная',
37
- },
38
- { en: 'hovel', it: 'Tugurio', de: 'Schuppen/Scheune', ru: 'сарай' },
39
- { en: 'summerhouse', it: 'casa estiva', de: 'Gartenhaus', ru: 'теплица' },
40
- { en: 'undefined', it: 'Non definito', de: 'Nicht definiert', ru: 'без комнаты' },
41
- ];
42
-
43
- module.exports = function (lang, word) {
44
- return translate(dictionary, lang, word);
45
- };
package/lib/texts.js DELETED
@@ -1,79 +0,0 @@
1
- const dictionary = {
2
- 'Answer from ioBroker': {
3
- en: 'Answer from ioBroker',
4
- ru: 'Ответ от ioBroker',
5
- de: 'Antwort vom ioBroker',
6
- },
7
- 'The service deactivated': {
8
- en: 'The service deactivated',
9
- ru: 'Сервис отключен',
10
- de: 'Der service ist deaktiviert',
11
- },
12
- 'missing inputs': {
13
- en: 'missing inputs',
14
- ru: 'Неправильные параметры',
15
- de: 'Falsche Parameter',
16
- },
17
- 'missing data': {
18
- en: 'missing data',
19
- ru: 'недостающие данные',
20
- de: 'fehlende Daten',
21
- it: 'dati mancanti',
22
- },
23
- 'missing intent': {
24
- en: 'missing intent',
25
- ru: 'недостающие данные',
26
- de: 'fehlende Daten',
27
- it: 'dati mancanti',
28
- },
29
- light: {
30
- en: '%s light',
31
- ru: '%s Свет',
32
- de: '%slight',
33
- it: '%s luce',
34
- },
35
- window: {
36
- en: '%s window',
37
- ru: '%s Окно',
38
- de: '%sfenster',
39
- it: '%s finestra',
40
- },
41
- blinds: {
42
- en: '%s blinds',
43
- ru: '%s Жалюзи',
44
- de: '%srollo',
45
- it: '%s persiane',
46
- },
47
- thermostat: {
48
- en: '%s thermostat',
49
- ru: '%s Термостат',
50
- de: '%sthermostat',
51
- it: '%s termostato',
52
- },
53
- media: {
54
- en: '%s media',
55
- ru: '%s Медиа',
56
- de: '%smedia',
57
- it: '%s media',
58
- },
59
- Error: {
60
- en: 'Error',
61
- de: 'Error',
62
- ru: 'Ошибка',
63
- pt: 'Erro',
64
- nl: 'Fout',
65
- fr: 'Erreur',
66
- it: 'Errore',
67
- es: 'Error',
68
- pl: 'Błąd',
69
- 'zh-cn': '错误',
70
- },
71
- };
72
-
73
- module.exports = function (lang, word, arg) {
74
- if (dictionary[word]) {
75
- word = dictionary[word][lang] || dictionary[word].en;
76
- }
77
-
78
- return word.replace('%s', arg);
79
- };
package/lib/translate.js DELETED
@@ -1,19 +0,0 @@
1
- module.exports = function (dictionary, language, word) {
2
- let _word = (word || '').toString().toLowerCase();
3
- for (let r = 0; r < dictionary.length; r++) {
4
- for (let l in dictionary[r]) {
5
- if (dictionary[r].hasOwnProperty(l)) {
6
- let words = dictionary[r][l].toLowerCase().split('/');
7
- if (words.includes(_word)) {
8
- if (dictionary[r][language]) {
9
- return dictionary[r][language].split('/')[0];
10
- } else {
11
- return dictionary[r].en.split('/')[0];
12
- }
13
- }
14
- }
15
- }
16
- }
17
-
18
- return word;
19
- };
package/lib/visuApp.js DELETED
@@ -1,157 +0,0 @@
1
- /** @typedef {{ command: 'sendToAdapter', instance: string, message: string, data: any }} SendToAdapterCommand */
2
-
3
- /**
4
- * Handles `sendToAdapter` command
5
- * @param {SendToAdapterCommand} visuData the data sent by the app
6
- * @param {ioBroker.Adapter} adapter the adapter instance
7
- * @returns {Promise<Record<string, any>>}
8
- */
9
- async function handleSendToAdapter(visuData, adapter) {
10
- const { instance, message, data } = visuData;
11
-
12
- const resp = await adapter.sendToAsync(instance, message, data, { timeout: 2_000 });
13
- return { ...resp };
14
- }
15
-
16
- /** @typedef {{ command: 'getInstances', adapterName: string }} GetInstancesCommand */
17
-
18
- /**
19
- * Handles `sendToAdapter` command
20
- * @param {GetInstancesCommand} visuData the data sent by the app
21
- * @param {ioBroker.Adapter} adapter the adapter instance
22
- * @returns {Promise<{ instances: string[] }>}
23
- */
24
- async function handleGetInstances(visuData, adapter) {
25
- const { adapterName } = visuData;
26
-
27
- const res = await adapter.getObjectViewAsync('system', 'instance', {
28
- startkey: `system.adapter.${adapterName}.`,
29
- endkey: `system.adapter.${adapterName}.\u9999`,
30
- });
31
-
32
- const instances = res.rows.map(item => item.id.substring('system.adapter.'.length));
33
- return { instances };
34
- }
35
-
36
- /**
37
- * Handle Geofence data update from app
38
- *
39
- * @param {{ presence: Record<string, boolean>, devices?: Record<string, any> }} visuData the data sent by app
40
- * @param {ioBroker.Adapter} adapter the adapter instance
41
- */
42
- async function handleGeofenceData(visuData, adapter) {
43
- await adapter.setObjectNotExistsAsync('app.geofence', {
44
- type: 'folder',
45
- common: {
46
- name: 'Geofence',
47
- desc: 'Collection of all the Geofence-locations managed by ioBroker Visu App',
48
- },
49
- native: {},
50
- });
51
-
52
- for (const [locationName, presenceStatus] of Object.entries(visuData.presence)) {
53
- const id = `app.geofence.${locationName.replace(adapter.FORBIDDEN_CHARS, '_').replace(/\s|ä|ü|ö/g, '_')}`;
54
-
55
- await adapter.setObjectNotExistsAsync(id, {
56
- type: 'state',
57
- common: {
58
- name: locationName,
59
- desc: `Geofence Status of ${locationName}`,
60
- type: 'boolean',
61
- read: true,
62
- write: false,
63
- role: 'indicator',
64
- },
65
- native: {},
66
- });
67
-
68
- await adapter.setStateAsync(id, presenceStatus, true);
69
- }
70
- }
71
-
72
- /**
73
- * Handle device's data update from app
74
- *
75
- * @param {{ presence?: Record<string, boolean>, devices: Record<string, any> }} visuData the data sent by app
76
- * @param {ioBroker.Adapter} adapter the adapter instance
77
- */
78
- async function handleDevicesData(visuData, adapter) {
79
- // e.g. {"devices":{"iPhone":{"batteryLevel":95,"batteryState":2,"ssid":"FRITZ!Box Fon WLAN","connectionType":"wifi"}}}
80
- for (const [deviceName, deviceData] of Object.entries(visuData.devices)) {
81
- const deviceId = `app.devices.${deviceName.replace(adapter.FORBIDDEN_CHARS, '_').replace(/\s|ä|ü|ö/g, '_')}`;
82
- await adapter.setObjectNotExistsAsync(deviceId, {
83
- type: 'folder',
84
- common: {
85
- name: 'Geofence',
86
- desc: 'Collection of all the Geofence-locations managed by ioBroker Visu App',
87
- },
88
- native: {},
89
- });
90
-
91
- for (const [dataName, dataVal] of Object.entries(deviceData)) {
92
- const id = `${deviceId}.${dataName}`;
93
-
94
- if (!commonMapping[dataName]) {
95
- adapter.log.warn(`Unknown device data "${dataName}" with value "${dataVal}"`);
96
- }
97
-
98
- await adapter.setObjectNotExistsAsync(id, {
99
- type: 'state',
100
- common: commonMapping[dataName],
101
- native: {},
102
- });
103
-
104
- await adapter.setState(id, dataVal, true);
105
- }
106
- }
107
- }
108
-
109
- /** Map data name to state common */
110
- const commonMapping = {
111
- ssid: {
112
- name: 'Current connected WiFi',
113
- desc: 'Current connected WiFi network',
114
- type: 'string',
115
- read: true,
116
- write: false,
117
- role: 'text',
118
- },
119
- connectionType: {
120
- name: 'Current connection type',
121
- desc: 'Current connection type',
122
- type: 'string',
123
- read: true,
124
- write: false,
125
- role: 'text',
126
- },
127
- batteryLevel: {
128
- name: 'Current battery level',
129
- desc: 'Current battery level',
130
- type: 'number',
131
- read: true,
132
- write: false,
133
- role: 'level.battery',
134
- unit: '%',
135
- },
136
- batteryState: {
137
- name: 'Current battery state',
138
- desc: 'Current battery state',
139
- type: 'number',
140
- read: true,
141
- write: false,
142
- role: 'value',
143
- states: {
144
- 0: 'unknown',
145
- 1: 'unplugged',
146
- 2: 'charging',
147
- 3: 'full',
148
- },
149
- },
150
- };
151
-
152
- module.exports = {
153
- handleGetInstances,
154
- handleSendToAdapter,
155
- handleGeofenceData,
156
- handleDevicesData,
157
- };