Bulk edit linter errors. (#1438)

* Bulk edit linter errors.

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>
pull/1439/head
Jerome Luckenbach 2021-01-10 20:22:40 +01:00 committed by GitHub
parent a3260307b0
commit 82c751d0df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 28 deletions

View File

@ -15,8 +15,14 @@ rule 'MD024', :allow_different_nesting => true
# Allow Multiple top level headers in the same document
exclude_rule 'MD025'
# Allow trailing punctuation in headers
exclude_rule 'MD026'
# Allow inline HTML
exclude_rule 'MD033'
# Allow bare urls (at least until they don't produce errors in source code blocks anymore)
exclude_rule 'MD033'
# Allow Frontmatter and exclude top level header on first line rule
exclude_rule 'MD041'

View File

@ -62,7 +62,7 @@ You have different options to execute a command through an action.
- `executeCommandLine(String commandLine)`: Executes a command on the command line without waiting for the command to complete.
For example you could run `executeCommandLine("path/to/my/script.sh")` which then would be executed and the rule would continue processing.
- `executeCommandLine(Duration.ofSeconds(timeout), String commandLine)`: Executes a command on the command and waits `timeout` seconds for the command to complete, returning the output from the command as a String
- `executeCommandLine(Duration.ofSeconds(timeout), String commandLine)`: Executes a command on the command and waits `timeout` seconds for the command to complete, returning the output from the command as a String.
For example you could run `var ScriptResponse = executeCommandLine(Duration.ofSeconds(60), "path/to/my/script.sh");` would get executed and wait 1 minute for the output to be responded back and write it into the `ScriptResponse` variable.
Other Durations than `ofSeconds` units are possible too.

View File

@ -409,8 +409,8 @@ There are two ways to discover these methods:
- Use the [openHAB VS Code Extension](/docs/configuration/editors.html#editors.html#openhab-vs-code-extension) and the `<ctrl><space>` key combo to list all the available methods
- Look at the JavaDocs for the given type.
For example, the [JavaDoc for HSBType](https://openhab.org/javadoc/latest/org/openhab/core/library/types/hsbtype) shows getRed, getBlue, and getGreen methods.
These methods can be called in Rules-DSL without the "get" part in name as in `(MyColorItem.state as HSBType).red)`.
For example, the [JavaDoc for HSBType](https://openhab.org/javadoc/latest/org/openhab/core/library/types/hsbtype) shows `getRed`, `getBlue`, and `getGreen` methods.
These methods can be called in Rules-DSL without the `get` part in name as in `(MyColorItem.state as HSBType).red)`.
They retrieve the state of MyColorItem and then casts it as HSBType to be able to use the methods associated with the HSBType.
{: #conversions}

View File

@ -164,6 +164,7 @@ For example:
Groups allow parameters to be grouped together into logical blocks so that the user can find the parameters they are looking for.
A parameter can be placed into a group so that the UI knows how to display the information.
<table>
<tr><td><b>Property</b></td><td><b>Description</b></td></tr>
<tr><td>group.name</td><td>The group name - this is used to link the parameters into the group, along with the groupName option in the parameter (mandatory).</td></tr>

View File

@ -12,8 +12,7 @@ If you do not find an answer to your question, do not hesitate to ask it on the
## Structuring Things and Thing Types
1. _I am implementing a binding for system X.
Shall I design this as one Thing or as a Bridge with multiple Things for the different functionalities?_
1. _I am implementing a binding for system X. Shall I design this as one Thing or as a Bridge with multiple Things for the different functionalities?_
In general, both options are valid:
@ -34,16 +33,14 @@ Shall I design this as one Thing or as a Bridge with multiple Things for the dif
Nonetheless, the static XML descriptions of thing types can be picked up for documentation generation and other purposes.
So whenever possible, static XML descriptions should be provided.
1. _For my system XY, there are so many different variants of devices.
Do I really need to define a thing type for every single one of them?_
1. _For my system XY, there are so many different variants of devices. Do I really need to define a thing type for every single one of them?_
Thing types are important if you have no chance to request any structural information about the devices from your system and if you need users to manually chose a thing to add or configure (i.e. there is also no automatic discovery).
The thing types that you provide will be the list the user can choose from.
If your system supports auto-discovery and you can also dynamically construct things (and their channels) from structural information that you can access during runtime, there is in theory no need to provide any thing type description at all.
Nonetheless, static descriptions of thing types have the advantage that the user knows which kind of devices are supported, no matter if he has a device at home or not - so you should at least have static XML descriptions for the devices that are known to you at implementation time.
1. _I have a device that can have different firmware versions with slightly different functionality.
Should I create one or two thing types for it?_
1. _I have a device that can have different firmware versions with slightly different functionality. Should I create one or two thing types for it?_
If the firmware version makes a huge difference for the device (and can be seen as a different model of it), then it is ok to have different things defined.
If the list of channels can be determined by knowing the firmware revision, this is good.