node-red-contrib-knx-ultimate 6.2.3-beta.2 → 6.2.3-beta.4
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.
- package/CHANGELOG.md +6 -4
- package/nodes/commonFunctions.js +46 -2
- package/nodes/knxUltimateHueAreaMotion.html +5 -1
- package/nodes/knxUltimateHueBattery.html +5 -1
- package/nodes/knxUltimateHueButton.html +5 -1
- package/nodes/knxUltimateHueCameraMotion.html +5 -1
- package/nodes/knxUltimateHueContactSensor.html +5 -1
- package/nodes/knxUltimateHueController.html +5 -1
- package/nodes/knxUltimateHueHumiditySensor.html +5 -1
- package/nodes/knxUltimateHueLight.html +5 -1
- package/nodes/knxUltimateHueLightSensor.html +5 -1
- package/nodes/knxUltimateHueMotion.html +5 -1
- package/nodes/knxUltimateHuePlug.html +5 -1
- package/nodes/knxUltimateHueScene.html +5 -1
- package/nodes/knxUltimateHueTapDial.html +5 -1
- package/nodes/knxUltimateHueTemperatureSensor.html +5 -1
- package/nodes/knxUltimateHueZigbeeConnectivity.html +5 -1
- package/nodes/knxUltimateHuedevice_software_update.html +5 -1
- package/nodes/locales/de/knxUltimateHueAreaMotion.html +1 -1
- package/nodes/locales/de/knxUltimateHueBattery.html +1 -1
- package/nodes/locales/de/knxUltimateHueButton.html +1 -1
- package/nodes/locales/de/knxUltimateHueCameraMotion.html +1 -1
- package/nodes/locales/de/knxUltimateHueContactSensor.html +1 -1
- package/nodes/locales/de/knxUltimateHueController.html +3 -3
- package/nodes/locales/de/knxUltimateHueController.json +7 -4
- package/nodes/locales/de/knxUltimateHueHumiditySensor.html +1 -1
- package/nodes/locales/de/knxUltimateHueLight.html +1 -1
- package/nodes/locales/de/knxUltimateHueLightSensor.html +1 -1
- package/nodes/locales/de/knxUltimateHueMotion.html +1 -1
- package/nodes/locales/de/knxUltimateHuePlug.html +1 -1
- package/nodes/locales/de/knxUltimateHueScene.html +1 -1
- package/nodes/locales/de/knxUltimateHueTapDial.html +1 -1
- package/nodes/locales/de/knxUltimateHueTemperatureSensor.html +1 -1
- package/nodes/locales/de/knxUltimateHueZigbeeConnectivity.html +1 -1
- package/nodes/locales/de/knxUltimateHuedevice_software_update.html +1 -1
- package/nodes/locales/de/matter-config.html +1 -1
- package/nodes/locales/en/knxUltimateHueAreaMotion.html +1 -1
- package/nodes/locales/en/knxUltimateHueBattery.html +1 -1
- package/nodes/locales/en/knxUltimateHueButton.html +1 -1
- package/nodes/locales/en/knxUltimateHueCameraMotion.html +1 -1
- package/nodes/locales/en/knxUltimateHueContactSensor.html +1 -1
- package/nodes/locales/en/knxUltimateHueController.html +3 -3
- package/nodes/locales/en/knxUltimateHueController.json +7 -4
- package/nodes/locales/en/knxUltimateHueHumiditySensor.html +1 -1
- package/nodes/locales/en/knxUltimateHueLight.html +1 -1
- package/nodes/locales/en/knxUltimateHueLightSensor.html +1 -1
- package/nodes/locales/en/knxUltimateHueMotion.html +1 -1
- package/nodes/locales/en/knxUltimateHuePlug.html +1 -1
- package/nodes/locales/en/knxUltimateHueScene.html +1 -1
- package/nodes/locales/en/knxUltimateHueTapDial.html +1 -1
- package/nodes/locales/en/knxUltimateHueTemperatureSensor.html +1 -1
- package/nodes/locales/en/knxUltimateHueZigbeeConnectivity.html +1 -1
- package/nodes/locales/en/knxUltimateHuedevice_software_update.html +1 -1
- package/nodes/locales/en/matter-config.html +1 -1
- package/nodes/locales/es/knxUltimateHueAreaMotion.html +1 -1
- package/nodes/locales/es/knxUltimateHueBattery.html +1 -1
- package/nodes/locales/es/knxUltimateHueButton.html +1 -1
- package/nodes/locales/es/knxUltimateHueCameraMotion.html +1 -1
- package/nodes/locales/es/knxUltimateHueContactSensor.html +1 -1
- package/nodes/locales/es/knxUltimateHueController.html +3 -3
- package/nodes/locales/es/knxUltimateHueController.json +7 -4
- package/nodes/locales/es/knxUltimateHueHumiditySensor.html +1 -1
- package/nodes/locales/es/knxUltimateHueLight.html +1 -1
- package/nodes/locales/es/knxUltimateHueLightSensor.html +1 -1
- package/nodes/locales/es/knxUltimateHueMotion.html +1 -1
- package/nodes/locales/es/knxUltimateHuePlug.html +1 -1
- package/nodes/locales/es/knxUltimateHueScene.html +1 -1
- package/nodes/locales/es/knxUltimateHueTapDial.html +1 -1
- package/nodes/locales/es/knxUltimateHueTemperatureSensor.html +1 -1
- package/nodes/locales/es/knxUltimateHueZigbeeConnectivity.html +1 -1
- package/nodes/locales/es/knxUltimateHuedevice_software_update.html +1 -1
- package/nodes/locales/es/matter-config.html +1 -1
- package/nodes/locales/fr/knxUltimateHueAreaMotion.html +1 -1
- package/nodes/locales/fr/knxUltimateHueBattery.html +1 -1
- package/nodes/locales/fr/knxUltimateHueButton.html +1 -1
- package/nodes/locales/fr/knxUltimateHueCameraMotion.html +1 -1
- package/nodes/locales/fr/knxUltimateHueContactSensor.html +1 -1
- package/nodes/locales/fr/knxUltimateHueController.html +3 -3
- package/nodes/locales/fr/knxUltimateHueController.json +7 -4
- package/nodes/locales/fr/knxUltimateHueHumiditySensor.html +1 -1
- package/nodes/locales/fr/knxUltimateHueLight.html +1 -1
- package/nodes/locales/fr/knxUltimateHueLightSensor.html +1 -1
- package/nodes/locales/fr/knxUltimateHueMotion.html +1 -1
- package/nodes/locales/fr/knxUltimateHuePlug.html +1 -1
- package/nodes/locales/fr/knxUltimateHueScene.html +1 -1
- package/nodes/locales/fr/knxUltimateHueTapDial.html +1 -1
- package/nodes/locales/fr/knxUltimateHueTemperatureSensor.html +1 -1
- package/nodes/locales/fr/knxUltimateHueZigbeeConnectivity.html +1 -1
- package/nodes/locales/fr/knxUltimateHuedevice_software_update.html +1 -1
- package/nodes/locales/fr/matter-config.html +1 -1
- package/nodes/locales/it/knxUltimateHueAreaMotion.html +1 -1
- package/nodes/locales/it/knxUltimateHueBattery.html +1 -1
- package/nodes/locales/it/knxUltimateHueButton.html +1 -1
- package/nodes/locales/it/knxUltimateHueCameraMotion.html +1 -1
- package/nodes/locales/it/knxUltimateHueContactSensor.html +1 -1
- package/nodes/locales/it/knxUltimateHueController.html +3 -3
- package/nodes/locales/it/knxUltimateHueController.json +7 -4
- package/nodes/locales/it/knxUltimateHueHumiditySensor.html +1 -1
- package/nodes/locales/it/knxUltimateHueLight.html +1 -1
- package/nodes/locales/it/knxUltimateHueLightSensor.html +1 -1
- package/nodes/locales/it/knxUltimateHueMotion.html +1 -1
- package/nodes/locales/it/knxUltimateHuePlug.html +1 -1
- package/nodes/locales/it/knxUltimateHueScene.html +1 -1
- package/nodes/locales/it/knxUltimateHueTapDial.html +1 -1
- package/nodes/locales/it/knxUltimateHueTemperatureSensor.html +1 -1
- package/nodes/locales/it/knxUltimateHueZigbeeConnectivity.html +1 -1
- package/nodes/locales/it/knxUltimateHuedevice_software_update.html +1 -1
- package/nodes/locales/it/matter-config.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueAreaMotion.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueBattery.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueButton.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueCameraMotion.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueContactSensor.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueController.html +3 -3
- package/nodes/locales/zh-CN/knxUltimateHueController.json +7 -4
- package/nodes/locales/zh-CN/knxUltimateHueHumiditySensor.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueLight.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueLightSensor.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueMotion.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHuePlug.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueScene.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueTapDial.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueTemperatureSensor.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueZigbeeConnectivity.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHuedevice_software_update.html +1 -1
- package/nodes/locales/zh-CN/matter-config.html +1 -1
- package/nodes/matter-config.html +67 -6
- package/nodes/matter-config.js +51 -0
- package/nodes/utils/matterEngine.mjs +111 -2
- package/package.json +1 -1
- package/resources/hueControllerMigrationDialog.js +45 -40
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
const EVENT_NAMESPACE = '.knxUltimateHueControllerMigrationDialog'
|
|
14
14
|
const BUTTON_SELECTOR = '.hue-legacy-migrate-flow'
|
|
15
|
+
const BUTTON_STYLE_ID = 'knxUltimateHueLegacyMigrationButtonStyle'
|
|
15
16
|
const I18N_PREFIX = 'node-red-contrib-knx-ultimate/knxUltimateHueController:knxUltimateHueController.'
|
|
16
17
|
let closeActiveDialog = function () {}
|
|
17
18
|
|
|
@@ -35,28 +36,38 @@
|
|
|
35
36
|
if ($cancel.length) $cancel.trigger('click')
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
function ensureLegacyButtonStyle ($) {
|
|
40
|
+
if ($(`#${BUTTON_STYLE_ID}`).length) return
|
|
41
|
+
$('<style></style>')
|
|
42
|
+
.attr('id', BUTTON_STYLE_ID)
|
|
43
|
+
.text(`
|
|
44
|
+
.hue-legacy-migrate-flow.red-ui-button,
|
|
45
|
+
.hue-legacy-migrate-flow.red-ui-button:hover,
|
|
46
|
+
.hue-legacy-migrate-flow.red-ui-button:active,
|
|
47
|
+
.hue-legacy-migrate-flow.red-ui-button:focus,
|
|
48
|
+
.hue-legacy-migrate-flow.red-ui-button > i,
|
|
49
|
+
.hue-legacy-migrate-flow.red-ui-button > span {
|
|
50
|
+
color: #ffffff !important;
|
|
51
|
+
}
|
|
52
|
+
`)
|
|
53
|
+
.appendTo('head')
|
|
49
54
|
}
|
|
50
55
|
|
|
51
|
-
function
|
|
56
|
+
function openDonationPage (RED, translate, windowObject, donationUrl) {
|
|
52
57
|
try {
|
|
53
|
-
if (
|
|
54
|
-
|
|
58
|
+
if (!windowObject || typeof windowObject.open !== 'function') throw new Error('Browser window opening is unavailable')
|
|
59
|
+
const donationWindow = windowObject.open(donationUrl, '_blank', 'noopener,noreferrer')
|
|
60
|
+
if (!donationWindow) throw new Error('The browser blocked the donation window')
|
|
61
|
+
} catch (error) {
|
|
62
|
+
if (RED && typeof RED.notify === 'function') {
|
|
63
|
+
RED.notify(translate('migration_donation_failed', 'The donation page could not be opened. You can try again.'), 'warning')
|
|
64
|
+
}
|
|
65
|
+
}
|
|
55
66
|
}
|
|
56
67
|
|
|
57
|
-
function showCompletionMessage (RED, translate, convertedCount) {
|
|
68
|
+
function showCompletionMessage (RED, translate, convertedCount, windowObject, donationUrl) {
|
|
58
69
|
if (!RED || typeof RED.notify !== 'function') return
|
|
59
|
-
const message = translate('migration_success', 'Process finished. {{count}} legacy HUE nodes were converted. Inspect every modified node, including its function, configuration, pins and wiring, before clicking Deploy.')
|
|
70
|
+
const message = translate('migration_success', 'Process finished. {{count}} legacy HUE nodes were converted. Inspect every modified node, including its function, configuration, pins and wiring, before clicking Deploy. If this conversion saved you time, you can support the continued development of KNX Ultimate with the optional button below.')
|
|
60
71
|
.replace('{{count}}', String(convertedCount))
|
|
61
72
|
let notification
|
|
62
73
|
try {
|
|
@@ -64,13 +75,22 @@
|
|
|
64
75
|
modal: true,
|
|
65
76
|
fixed: true,
|
|
66
77
|
type: 'success',
|
|
67
|
-
buttons: [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
buttons: [
|
|
79
|
+
{
|
|
80
|
+
text: translate('migration_donate', 'Support KNX Ultimate ❤️'),
|
|
81
|
+
class: 'hue-controller-migration-donate',
|
|
82
|
+
click () {
|
|
83
|
+
openDonationPage(RED, translate, windowObject, donationUrl)
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
text: translate('migration_ok', 'OK'),
|
|
88
|
+
class: 'primary',
|
|
89
|
+
click () {
|
|
90
|
+
if (notification && typeof notification.close === 'function') notification.close()
|
|
91
|
+
}
|
|
72
92
|
}
|
|
73
|
-
|
|
93
|
+
]
|
|
74
94
|
})
|
|
75
95
|
} catch (error) { /* the conversion is already complete */ }
|
|
76
96
|
}
|
|
@@ -114,7 +134,7 @@
|
|
|
114
134
|
.css({ marginBottom: '10px', padding: '8px 10px', borderLeft: '4px solid #2980b9', background: '#eaf4fb' })
|
|
115
135
|
.appendTo($dialog)
|
|
116
136
|
$('<div class="hue-controller-migration-email"></div>')
|
|
117
|
-
.text(translate('migration_email_notice', 'After conversion, your email app will open an editable draft addressed to the author without navigating away from Node-RED
|
|
137
|
+
.text(translate('migration_email_notice', 'After conversion, your email app will open an editable draft addressed to the author without navigating away from Node-RED. The draft contains only the number of converted nodes and space for optional notes; nothing is sent automatically. The final Node-RED message will offer an optional button to support KNX Ultimate.'))
|
|
118
138
|
.css({ marginBottom: '10px' })
|
|
119
139
|
.appendTo($dialog)
|
|
120
140
|
$('<div class="form-tips hue-controller-migration-backup"></div>')
|
|
@@ -144,10 +164,8 @@
|
|
|
144
164
|
if (running) return
|
|
145
165
|
running = true
|
|
146
166
|
$convert.prop('disabled', true)
|
|
147
|
-
let donationWindow
|
|
148
167
|
try {
|
|
149
168
|
migrationApi.createLocalMigrationPatches(legacyNodes)
|
|
150
|
-
donationWindow = reserveDonationWindow(windowObject)
|
|
151
169
|
closeDialog()
|
|
152
170
|
closeEditorTray(RED, $)
|
|
153
171
|
windowObject.setTimeout(() => {
|
|
@@ -155,23 +173,10 @@
|
|
|
155
173
|
try {
|
|
156
174
|
convertedCount = migrationApi.applyLocalMigration(RED, legacyNodes)
|
|
157
175
|
} catch (error) {
|
|
158
|
-
closeDonationWindow(donationWindow)
|
|
159
176
|
const message = error && error.message ? error.message : String(error)
|
|
160
177
|
RED.notify(`${translate('migration_failed', 'HUE migration failed; the flow was not changed:')} ${message}`, 'error')
|
|
161
178
|
return
|
|
162
179
|
}
|
|
163
|
-
try {
|
|
164
|
-
if (donationWindow && !donationWindow.closed && donationWindow.location) {
|
|
165
|
-
donationWindow.location.href = migrationApi.MIGRATION_DONATION_URL
|
|
166
|
-
} else if (typeof windowObject.open === 'function') {
|
|
167
|
-
const opened = windowObject.open(migrationApi.MIGRATION_DONATION_URL, '_blank', 'noopener,noreferrer')
|
|
168
|
-
if (!opened) throw new Error('The browser blocked the donation window')
|
|
169
|
-
} else {
|
|
170
|
-
throw new Error('Browser window opening is unavailable')
|
|
171
|
-
}
|
|
172
|
-
} catch (error) {
|
|
173
|
-
RED.notify(translate('migration_donation_failed', 'The nodes were converted, but the donation page could not be opened.'), 'warning')
|
|
174
|
-
}
|
|
175
180
|
try {
|
|
176
181
|
const mailto = migrationApi.createUsageMailto(convertedCount, {
|
|
177
182
|
subject: translate('migration_email_subject', 'KNX Ultimate - legacy HUE conversion used'),
|
|
@@ -184,10 +189,9 @@
|
|
|
184
189
|
} catch (error) {
|
|
185
190
|
RED.notify(translate('migration_email_failed', 'The nodes were converted, but the email draft could not be opened.'), 'warning')
|
|
186
191
|
}
|
|
187
|
-
showCompletionMessage(RED, translate, convertedCount)
|
|
192
|
+
showCompletionMessage(RED, translate, convertedCount, windowObject, migrationApi.MIGRATION_DONATION_URL)
|
|
188
193
|
}, 0)
|
|
189
194
|
} catch (error) {
|
|
190
|
-
closeDonationWindow(donationWindow)
|
|
191
195
|
running = false
|
|
192
196
|
$convert.prop('disabled', false)
|
|
193
197
|
const message = error && error.message ? error.message : String(error)
|
|
@@ -222,6 +226,7 @@
|
|
|
222
226
|
|
|
223
227
|
function installLegacyButton (RED, $, windowObject, documentObject) {
|
|
224
228
|
if (!RED || !$ || !documentObject) return
|
|
229
|
+
ensureLegacyButtonStyle($)
|
|
225
230
|
const $document = $(documentObject)
|
|
226
231
|
$document.off(`click${EVENT_NAMESPACE}`, BUTTON_SELECTOR)
|
|
227
232
|
$document.on(`click${EVENT_NAMESPACE}`, BUTTON_SELECTOR, (event) => {
|