Skip to content

Commit

Permalink
chore: release v7.5.0
Browse files Browse the repository at this point in the history
* (klein0r) Day of week as number always returns 1 (monday) to 7 (sunday)
* (klein0r) Fixed layout of script type selection
* (klein0r) Fixed sendto with multiple instances (for callback / timeout handling)
  • Loading branch information
klein0r committed Dec 15, 2023
1 parent 17b30cb commit 56a591d
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 66 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG_OLD.md
@@ -1,4 +1,7 @@
The newest change log is in README.md
## 7.1.5 (2023-10-09)
* (bluefox) Added play-ground for ChatGPT (API key required)

## 7.1.4 (2023-08-09)
* (bluefox) Added version to the side menu
* (klein0r) Added blockly blocks for `getHistory` and calculated times
Expand Down
5 changes: 1 addition & 4 deletions README.md
Expand Up @@ -46,7 +46,7 @@ Since v5.5.0 of the JavaScript adapter the following locations (relative to the
<!--
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**
### 7.5.0 (2023-12-15)

* (klein0r) Day of week as number always returns 1 (monday) to 7 (sunday)
* (klein0r) Fixed layout of script type selection
Expand Down Expand Up @@ -79,9 +79,6 @@ NodeJS 16.x is required
### 7.1.6 (2023-10-24)
* (bluefox) Fixed pushover rules block

### 7.1.5 (2023-10-09)
* (bluefox) Added play-ground for ChatGPT (API key required)

## License
The MIT License (MIT)

Expand Down
10 changes: 5 additions & 5 deletions admin/asset-manifest.json
@@ -1,8 +1,8 @@
{
"files": {
"main.js": "/static/js/main.01380d13.js",
"main.js": "/static/js/main.e35235fb.js",
"static/css/864.42bfc5f3.chunk.css": "/static/css/864.42bfc5f3.chunk.css",
"static/js/864.d7c7a956.chunk.js": "/static/js/864.d7c7a956.chunk.js",
"static/js/864.12f7e04a.chunk.js": "/static/js/864.12f7e04a.chunk.js",
"static/js/90.356ce273.chunk.js": "/static/js/90.356ce273.chunk.js",
"static/js/750.cbf4f684.chunk.js": "/static/js/750.cbf4f684.chunk.js",
"static/js/723.6006b5e8.chunk.js": "/static/js/723.6006b5e8.chunk.js",
Expand Down Expand Up @@ -157,9 +157,9 @@
"static/media/Garage Doors.svg": "/static/media/Garage Doors.0c2a1cfca7ad1ea59625.svg",
"static/media/Outdoor Blinds.svg": "/static/media/Outdoor Blinds.37b85a9c060a4af48da9.svg",
"static/media/Upstairs.svg": "/static/media/Upstairs.441813e54e0daca0882d.svg",
"main.01380d13.js.map": "/static/js/main.01380d13.js.map",
"main.e35235fb.js.map": "/static/js/main.e35235fb.js.map",
"864.42bfc5f3.chunk.css.map": "/static/css/864.42bfc5f3.chunk.css.map",
"864.d7c7a956.chunk.js.map": "/static/js/864.d7c7a956.chunk.js.map",
"864.12f7e04a.chunk.js.map": "/static/js/864.12f7e04a.chunk.js.map",
"90.356ce273.chunk.js.map": "/static/js/90.356ce273.chunk.js.map",
"750.cbf4f684.chunk.js.map": "/static/js/750.cbf4f684.chunk.js.map",
"723.6006b5e8.chunk.js.map": "/static/js/723.6006b5e8.chunk.js.map",
Expand Down Expand Up @@ -189,6 +189,6 @@
"360.59624b85.chunk.js.map": "/static/js/360.59624b85.chunk.js.map"
},
"entrypoints": [
"static/js/main.01380d13.js"
"static/js/main.e35235fb.js"
]
}
36 changes: 18 additions & 18 deletions admin/google-blockly/own/blocks_convert.js
Expand Up @@ -259,41 +259,41 @@ Blockly.JavaScript.convert_from_date = function (block) {

let code;
if (option === 'object') {
code = 'getDateObject(' + value + ').getTime()';
code = `getDateObject(${value}).getTime()`;
} else if (option === 'ms') {
code = 'getDateObject(' + value + ').getMilliseconds()';
code = `getDateObject(${value}).getMilliseconds()`;
} else if (option === 's') {
code = 'getDateObject(' + value + ').getSeconds()';
code = `getDateObject(${value}).getSeconds()`;
} else if (option === 'sid') {
code = '(function () { const v = getDateObject(' + value + '); return v.getHours() * 3600 + v.getMinutes() * 60 + v.getSeconds(); })()';
code = `(() => { const v = getDateObject(${value}); return v.getHours() * 3600 + v.getMinutes() * 60 + v.getSeconds(); })()`;
} else if (option === 'm') {
code = '(getDateObject(' + value + ').getMinutes())';
code = `getDateObject(${value}).getMinutes())`;
} else if (option === 'mid') {
code = '(function () { const v = getDateObject(' + value + '); return v.getHours() * 60 + v.getMinutes(); })()';
code = `(() => { const v = getDateObject(${value}); return v.getHours() * 60 + v.getMinutes(); })()`;
} else if (option === 'h') {
code = 'getDateObject(' + value + ').getHours()';
code = `getDateObject(${value}).getHours()`;
} else if (option === 'd') {
code = 'getDateObject(' + value + ').getDate()';
code = `getDateObject(${value}).getDate()`;
} else if (option === 'M') {
code = '(getDateObject(' + value + ').getMonth() + 1)';
code = `(getDateObject(${value}).getMonth() + 1)`;
} else if (option === 'Mt') {
code = 'formatDate(getDateObject(' + value + '), "OO", "' + lang + '")';
code = `formatDate(getDateObject(${value}), 'OO', '${lang}')`;
} else if (option === 'Mts') {
code = 'formatDate(getDateObject(' + value + '), "O", "' + lang + '")';
code = `formatDate(getDateObject(${value}), 'O', '${lang}')`;
} else if (option === 'y') {
code = 'getDateObject(' + value + ').getYear()';
code = `getDateObject(${value}).getYear()`;
} else if (option === 'fy') {
code = 'getDateObject(' + value + ').getFullYear()';
code = `getDateObject(${value}).getFullYear()`;
} else if (option === 'wdt') {
code = 'formatDate(getDateObject(' + value + '), "WW", "' + lang + '")';
code = `formatDate(getDateObject(${value}), 'WW', '${lang}')`;
} else if (option === 'wdts') {
code = 'formatDate(getDateObject(' + value + '), "W", "' + lang + '")';
code = `formatDate(getDateObject(${value}), 'W', '${lang}')`;
} else if (option === 'wd') {
code = 'getDateObject(' + value + ').getDay()';
code = `(() => { const d = getDateObject(${value}).getDay(); return d === 0 ? 7 : d; })()`;
} else if (option === 'custom') {
code = 'formatDate(getDateObject(' + value + '), "' + format + '")';
code = `formatDate(getDateObject(${value}), '${format}')`;
} else {
code = 'formatDate(getDateObject(' + value + '), "' + option + '")';
code = `formatDate(getDateObject(${value}), '${option}')`;
}

return [code, Blockly.JavaScript.ORDER_ATOMIC];
Expand Down
4 changes: 2 additions & 2 deletions admin/google-blockly/own/blocks_time.js
Expand Up @@ -406,7 +406,7 @@ Blockly.JavaScript['time_get'] = function(block) {
} else if (option === 's') {
code = '(new Date().getSeconds())';
} else if (option === 'sid') {
code = '(new Date().getHours() * 3600 + new Date().getMinutes() * 60 + new Date().getSeconds())';
code = '(() => { const v = new Date(); return v.getHours() * 3600 + v.getMinutes() * 60 + v.getSeconds(); })()';
} else if (option === 'm') {
code = '(new Date().getMinutes())';
} else if (option === 'mid') {
Expand All @@ -430,7 +430,7 @@ Blockly.JavaScript['time_get'] = function(block) {
} else if (option === 'wdts') {
code = `formatDate(new Date(), 'W', '${lang}')`;
} else if (option === 'wd') {
code = '(new Date().getDay() === 0 ? 7 : new Date().getDay())';
code = '(() => { const d = new Date().getDay(); return d === 0 ? 7 : d; })()';
} else if (option === 'custom') {
code = `formatDate(new Date(), '${format}')`;
} else {
Expand Down
24 changes: 12 additions & 12 deletions admin/google-blockly/own/blocks_trigger.js
Expand Up @@ -388,13 +388,6 @@ Blockly.Blocks['on_source'] = {

this.appendDummyInput('ATTR')
.appendField(new Blockly.FieldDropdown([
[Blockly.Translate('on_source_id'), 'id'],
[Blockly.Translate('on_source_name'), 'common.name'],
[Blockly.Translate('on_source_desc'), 'common.desc'],
[Blockly.Translate('on_source_channel_id'), 'channelId'],
[Blockly.Translate('on_source_channel_name'), 'channelName'],
[Blockly.Translate('on_source_device_id'), 'deviceId'],
[Blockly.Translate('on_source_device_name'), 'deviceName'],
[Blockly.Translate('on_source_state_val'), 'state.val'],
[Blockly.Translate('on_source_state_ts'), 'state.ts'],
[Blockly.Translate('on_source_state_q'), 'state.q'],
Expand All @@ -403,6 +396,13 @@ Blockly.Blocks['on_source'] = {
[Blockly.Translate('on_source_state_lc'), 'state.lc'],
[Blockly.Translate('on_source_state_c'), 'state.c'],
[Blockly.Translate('on_source_state_user'), 'state.user'],
[Blockly.Translate('on_source_id'), 'id'],
[Blockly.Translate('on_source_name'), 'common.name'],
[Blockly.Translate('on_source_desc'), 'common.desc'],
[Blockly.Translate('on_source_channel_id'), 'channelId'],
[Blockly.Translate('on_source_channel_name'), 'channelName'],
[Blockly.Translate('on_source_device_id'), 'deviceId'],
[Blockly.Translate('on_source_device_name'), 'deviceName'],
[Blockly.Translate('on_source_oldstate_val'), 'oldState.val'],
[Blockly.Translate('on_source_oldstate_ts'), 'oldState.ts'],
[Blockly.Translate('on_source_oldstate_q'), 'oldState.q'],
Expand Down Expand Up @@ -455,9 +455,9 @@ Blockly.JavaScript['on_source'] = function(block) {
const parts = attr.split('.');

if (parts.length > 1) {
attr = '(obj.' + parts[0] + ' ? obj.' + attr + ' : "")';
attr = `(obj.${parts[0]} ? obj.${attr} : '')`;
} else {
attr = 'obj.' + attr;
attr = `obj.${attr}`;
}

return [attr, Blockly.JavaScript.ORDER_ATOMIC];
Expand Down Expand Up @@ -747,7 +747,7 @@ Blockly.Blocks['schedule_clear'] = {

Blockly.JavaScript['schedule_clear'] = function(block) {
const name = Blockly.JavaScript.variableDB_.safeName_(block.getFieldValue('NAME'));
return `(function () { if (${name}) { clearSchedule(${name}); ${name} = null; }})();\n`;
return `(() => { if (${name}) { clearSchedule(${name}); ${name} = null; }})();\n`;
};

// --- CRON dialog --------------------------------------------------
Expand Down Expand Up @@ -1004,7 +1004,7 @@ Blockly.Trigger.blocks['onFile'] =
'<block type="onFile">'
+ ' <value name="OID">'
+ ' <shadow type="field_oid_meta">'
+ ' <field name="oid">Meta Object ID</field>'
+ ' <field name="oid">0_userdata.0</field>'
+ ' </shadow>'
+ ' </value>'
+ ' <value name="FILE">'
Expand Down Expand Up @@ -1072,7 +1072,7 @@ Blockly.Trigger.blocks['offFile'] =
'<block type="offFile">'
+ ' <value name="OID">'
+ ' <shadow type="field_oid_meta">'
+ ' <field name="oid">Meta Object ID</field>'
+ ' <field name="oid">0_userdata.0</field>'
+ ' </shadow>'
+ ' </value>'
+ ' <value name="FILE">'
Expand Down
4 changes: 2 additions & 2 deletions admin/google-blockly/own/blocks_words.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions admin/static/js/864.12f7e04a.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions admin/static/js/864.12f7e04a.chunk.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions admin/static/js/864.d7c7a956.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion admin/static/js/864.d7c7a956.chunk.js.map

This file was deleted.

0 comments on commit 56a591d

Please sign in to comment.