Skip to content

Commit

Permalink
* (klein0r) Added variable timeout block
Browse files Browse the repository at this point in the history
* (klein0r) Added `getInterval` and `getTimeout` blocks
* (klein0r) Added `sendTo` for scripts and message trigger blocks
  • Loading branch information
GermanBluefox committed Jul 14, 2022
1 parent b6e104f commit e2c439e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ And then call `npm run build`.
-->
### **WORK IN PROGRESS**
* (klein0r) Added variable timeout block
* (klein0r) Added getinterval and gettimeout blocks
* (klein0r) Added sendTo for scripts and message trigger
* (klein0r) Added `getInterval` and `getTimeout` blocks
* (klein0r) Added `sendTo` for scripts and message trigger blocks

### 5.8.8 (2022-07-13)
* (bluefox) Corrected error by start of GUI
Expand Down
17 changes: 15 additions & 2 deletions docs/en/blockly.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- [Send to pushover](#send-to-pushover)
- [Send email](#send-email)
- [Custom sendTo block](#custom-sendto-block)
- [Send to other script](#send-to-other-script)
- [Date and Time blocks](#date-and-time-blocks)
- [Time comparision](#time-comparision)
- [Actual time comparision](#actual-time-comparision)
Expand All @@ -51,6 +52,7 @@
- [CRON rule](#cron-rule)
- [Trigger on file update](#trigger-on-file-update)
- [Cancel event on file update](#cancel-event-on-file-update)
- [Trigger on script event](#trigger-on-script-event)
- [Timeouts](#timeouts)
- [Wait/Pause](#wait)
- [Delayed execution](#delayed-execution)
Expand Down Expand Up @@ -1129,10 +1131,16 @@ sendTo("sql.0", "getHistory", {
});
```

If you start value with "{" it will be interpreted as JSON string. Use double quotes in string.
If you start value with `{` it will be interpreted as JSON string. Use double quotes in string.

### Send to other script
![Send to other script](img/sendto_otherscript_1_en.png)

With this block you can send message to other script and this message could be processed by [Event - receive message](#trigger-on-script-event) block.


## Date and Time blocks
### Time comparision
### Time comparison
![Time comparision](img/datetime_compare_ex_en.png)

If used operator "between" or "not between", the block looks like this:
Expand Down Expand Up @@ -1790,6 +1798,11 @@ With this block you can unsubscribe from events by file update.

**Important**: this functionality is only available with [email protected] or newer.

### Trigger on script event
![Trigger on script event](img/trigger_onScript_en.png)

With this block you can subscribe on inter-scripts events and execute some action.

## Timeouts
### Wait/Pause
With this simple block you can pause the execution of blocks.
Expand Down
Binary file added docs/en/img/sendto_otherscript_1_en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/en/img/trigger_onScript_en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.1.1",
"@iobroker/adapter-react-v5": "^3.1.19",
"@iobroker/adapter-react-v5": "^3.1.20",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.8.7",
"@mui/styles": "^5.8.7",
Expand Down Expand Up @@ -60,4 +60,4 @@
"eslint": "^8.19.0",
"eslint-config-react-app": "^7.0.1"
}
}
}
4 changes: 2 additions & 2 deletions src/public/google-blockly/own/blocks_sendto.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,11 @@ Blockly.Blocks['sendto_otherscript'] = {
}

this.appendDummyInput('NAME')
.appendField(Blockly.Translate('sendto_otherscript_name'))
.appendField(Blockly.Translate('sendto_otherscript_name'));

this.appendDummyInput('INSTANCE')
.appendField(Blockly.Translate('sendto_otherscript_instance'))
.appendField(new Blockly.FieldDropdown(options), "INSTANCE");
.appendField(new Blockly.FieldDropdown(options), 'INSTANCE');

this.appendValueInput('OID')
.appendField(Blockly.Translate('sendto_otherscript_script'))
Expand Down
1 change: 1 addition & 0 deletions src/src/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,7 @@ class Editor extends React.Component {
themeType={this.state.themeType}
socket={this.props.socket}
selected={selectedId}
expertMode={this.selectId.type === 'script' ? true : undefined}
// statesOnly={!this.selectId.type || this.selectId.type === 'state'}
types={[this.selectId.type || 'state']}
onClose={() => {
Expand Down

0 comments on commit e2c439e

Please sign in to comment.