[blockly] finalize blockly docs for M3.3 (#1843)

* [blockly] finalize blockly docs for M3.3

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>

* [blockly docs] remove MD025 check

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
pull/1856/head
stefan-hoehn 2022-07-05 21:22:53 +02:00 committed by GitHub
parent a2b28d76bd
commit f893c46646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 65 additions and 21 deletions

View File

@ -4,7 +4,7 @@ title: Rules Blockly
---
<!-- markdownlint-disable MD036 -->
# Blockly Reference 33
# Blockly Reference
One of the core feature that OpenHAB provides is writing rules to allow specific behaviour with the home automation system.
The usual way of developing rules is by coding them like described in the [Textual Rules](/docs/configuration/rules-dsl.html).
@ -32,22 +32,25 @@ All of these provide general functionality that is not specific to openHAB itsel
However, to leverage the full capabilities more than *50 specific blocks* have been provided that are tailored for easy access of openHAB's capabilities.
This section provides a detailed description of the specific blocks and provides examples on how to use them. Note that some of the blocks (like voice, streaming or notifications) need some special setup within openHAB - in these case links to the respective documentation is provided.
It should also be mentioned that each of the blocks do have a context sensitive menu which appears upon a right click on the block itself.
**Block context menu**
![blockly-context.png](../images/blockly/blockly-contextmenu.png)
**Looking for help**
A special mention should go towards the **Help** entry that links to a resource that is usually very helpful to understand the context of that particular block.
A special mention should go towards the **Help** entry in a block context menu [right click on any block](rules-blockly-before-using.html#block-context-menu) that links to a resource that is usually very helpful to understand the context of that particular block.
To retrieve the particular help for a block right click on a block to open the context menu and click on the **help**-entry:
![context-help](../images/blockly/blockly-context-help.png)
There is also a help-button available in each section that links to the documentation of the whole section.
![main-help-button](../images/blockly/blockly-main-help.png)
Please read this information first before asking questions in the forum. *In case you ask for help please always post the respective code that is being generated.*
## Before using blockly
Please visit [Getting started with openHAB Blocklies](rules-blockly-before-using.html) before asking questions in the forum
## Blocks
## Blocks Overview
### Items and Things
@ -71,7 +74,7 @@ See [Timers and Delays](rules-blockly-timers-and-delays.html) section.
### Date Handling
Date blocks are used as input parameters for other blocks.
At the moment some of these blocks are found in the ephemeris section, whilst others are found in the persistence section - they may be equally useful for both. These blocks are *typed* to assure correct connection to other blocks.
Some of these blocks are used by ephemeris blocks, whilst others are used in the persistence section. Therefore blocks are *typed* to assure correct connection to other blocks.
[![Date Handling](../images/blockly/blockly-date-handling1-small.png "Dates part 1")
](rules-blockly-date-handling.html) [![Date Handling](../images/blockly/blockly-date-handling2-small.png "Dates Part 2")

View File

@ -85,7 +85,43 @@ All methods reveal the following folders
- Press `Ctrl-s` (Windows) or `Command-s` (MacOS) to save your rule
- Press `Ctrl-r` (Windows) or `Command-r` (MacOS) to directly run your rule with the trigger
- Press `Ctrl-d` (Windows) or `Command-d` (MacOS) to disable / enable your rule
- Click on ![showcode](../images/blockly/blockly-showcode.png) on the lower right to see the generated code (click again to come back to the blocks)
- Click on ![showblock](../images/blockly/blockly-workspace-showblocks.png) on the lower right of the bottom toolbar to see the generated code and will transition to ![showcode](../images/blockly/blockly-workspace-showcode.png)(click again to come back to the blocks)
### Block context menu
It should also be mentioned that each of the blocks do have a context sensitive menu which appears upon a right click on the block itself.
![blockly-context.png](../images/blockly/blockly-contextmenu.png)
- **Duplicate**: Clones the block
- **Add comment**: Adds a comment to the block
- **Inline Inputs** / External inputs: Switches between horizontal or vertical alignment of inputs
Inline:
![inline-inputs](../images/blockly/blockly-inputs-inline.png)
External:
![external-inputs](../images/blockly/blockly-inputs-external.png)
- **Collapse (expand) block**: Shrinks the block to get a better overview
Normal block view:
![expanded-block](../images/blockly/blockly-expanded.png)
Collapsed view:
![collapsed-block](../images/blockly/blockly-collapsed.png)
- **Disable (enable) block**: Disables the block, so no code is generated and its functionality switched off
- **Delete**: delete the blocks (this can be reverted via Command/Ctrl-Z)
### Zoom the workspace
The following controls allow the workspace to be zoomed:
![workspace-zoom-controls](../images/blockly/blockly-zoom.png)
Pinching on a tablet or a touch bar also allows convenient zooming of the workspace.
## Use Frontail for viewing log files

View File

@ -81,7 +81,7 @@ The time is set to `00:00:00`.
Type: *ZonedDateTime*
This block will return the date as *ZonedDateTime* based on the given String.
The String may be one of the following formats (since 3.3.0M6 the following formats are supported)
The String may be one of the following formats (since 3.3) the following formats are supported)
- yyyy-MM-dd
- yyyy-MM-dd HH:mm
@ -117,7 +117,7 @@ Tip: if you want to create a datetime with your time zone use the "copy of"-bloc
### Create Datetime based on a specific date ("Copy Of")
since 3.3.0M6
since 3.3
![date-copy-of-overview](../images/blockly/blockly-date-copy-of-overview.png)
@ -197,7 +197,7 @@ This variable is then used as the value to amend the lastUpdatedTime of an item
### Datetime from item
since 3.3.0M6
since 3.3
![datetime-from-item](../images/blockly/blockly-datetime-from-item.png)
@ -215,7 +215,7 @@ Type: *String*
Returns the String representation of a given *ZonedDateTime*-block, with or without the time.
since 3.3.0M6: also returns the same datetime format that is used by openHAB itself
since 3.3: also returns the same datetime format that is used by openHAB itself
**Example**
@ -233,7 +233,7 @@ The output in the log will be.
### Date Comparison
since 3.3.0M6
since 3.3
![date-comparison](../images/blockly/blockly-date-comparison.png)
@ -246,7 +246,7 @@ Returns true/false based on the comparison
### Date Comparison Between
since 3.3.0M6
since 3.3
![date-comparison-between](../images/blockly/blockly-date-comparison-between.png)
@ -259,7 +259,7 @@ Returns true/false based on the comparison
### Get part of datetime
since 3.3.0M6
since 3.3
![date-getpartof](../images/blockly/blockly-date-unit-of.png)
@ -269,7 +269,7 @@ Returns the selected part of the datetime as a number.
### Get difference between datetimes
since 3.3.0M6
since 3.3
![date-getdifference](../images/blockly/blockly-date-difference.png)

View File

@ -4,8 +4,12 @@ title: Rules Blockly - Items & Things
---
<!-- markdownlint-disable MD036 -->
# Item & Things
[return to Blockly Reference](index.html#items-and-things)
## Introduction
*Items* and *Things* are the [major entities of openHAB](https://www.openhab.org/docs/concepts/) to control and monitor the home.
These can be accessed via the "Items & Things" section of the [Blockly Toolbox](/docs/configuration/index.html#blockly-toolbox).

View File

@ -39,7 +39,7 @@ These blocks enable arbitrary content to be published to the [openHAB log](https
- debug
- trace
Since OpenHAB 3.3.0M6: The block attached to the log-block is not restricted to a string type block anymore
Since 3.3: The block attached to the log-block is not restricted to a string type block anymore
### Print Statement

View File

@ -166,7 +166,7 @@ Provides the possibility to inject any ECMAScript at a given position.
This should be used in cases when Blockly does not provide the desired functionality.
Use with diligence.
### Example:
### Example
![inline-script-example](../images/blockly/blockly-inline-script-example.png)

View File

@ -70,7 +70,7 @@ An example is as follows:
![reschedule-timer-example1](../images/blockly/blockly-reschedule-timer-example1.png)
Setting up an endless timer in teh above way is not recommended. The example shown below will stop rescheduling after 3 doorbell rings.
Setting up an endless timer in the above way is not recommended. The example shown below will stop rescheduling after 3 doorbell rings.
![reschedule-timer-example2](../images/blockly/blockly-reschedule-timer-example2.png)
@ -179,6 +179,7 @@ if (typeof this.timers['rescheduleTimerBlock'] === 'undefined' || this.timers['r
### Timer is Running
![timer-is-running](../images/blockly/blockly-timer-is-running.png)
*Function*: returns `true` if the code *within the timer block* is currently running - i.e. the countdown has finished, and the code within the timer block is currently executing. This event will usually only last a few milliseconds, and youd be (un)lucky to catch it when your rule retriggers.
### Timer has terminated

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 356 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 KiB

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB