Skip to content

Commit

Permalink
Merge branch '2.5.x' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Rushworth authored Feb 27, 2020
2 parents 7c2039e + e21bd12 commit 7a69a0a
Show file tree
Hide file tree
Showing 70 changed files with 1,054 additions and 952 deletions.
6 changes: 0 additions & 6 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Add 'priority: middle 🔜' label to any file change
"priority: middle 🔜":
- '**'
- '.*'
- '.*/**'

"section => add-ons":
- addons/*

Expand Down
1 change: 1 addition & 0 deletions .vuepress/docs-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports = [
'installation/openhabian',
'installation/rasppi',
'installation/pine',
'installation/armbian',
'installation/docker',
'installation/synology',
'installation/qnap',
Expand Down
4 changes: 2 additions & 2 deletions .vuepress/process_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def process_file(indir, file, outdir, source)
puts " (add-on is from ESH)"
source = "https://github.com/eclipse/smarthome/blob/master/extensions/#{addon_type}/org.eclipse.smarthome.#{addon_type}.#{addon}/README.md"
elsif !(file =~ /things/) then
puts " (add-on is from openhab2-addons)"
source = "https://github.com/openhab/openhab2-addons/blob/master/addons/#{addon_type}/org.openhab.#{addon_type}.#{addon}/README.md"
puts " (add-on is from openhab-addons)"
source = "https://github.com/openhab/openhab-addons/blob/master/addons/#{addon_type}/org.openhab.#{addon_type}.#{addon}/README.md"
end

out.puts "source: #{source}" if source != ""
Expand Down
82 changes: 40 additions & 42 deletions .vuepress/process_main_docs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,25 @@ def process_main_docs(docs_source_dir)
puts ">>> Migrating the introduction article"
process_file(".", "introduction.md", "docs", "https://github.com/openhab/openhab-docs/blob/master/introduction.md")
FileUtils.mv("docs/introduction.md", "docs/readme.md")


puts ">>> Migrating common images"
FileUtils.mkdir_p("docs/images")
FileUtils.cp_r("#{docs_source_dir}/images/distro.png", "docs/images")
FileUtils.cp_r("#{docs_source_dir}/images/dashboard.png", "docs/images")


puts ">>> Migrating logos"
FileUtils.cp_r("#{docs_source_dir}/images/addons", ".vuepress/public/logos")



puts ">>> Migrating the Concepts section"


if Dir.exists?("#{docs_source_dir}/concepts") then
Dir.glob("#{docs_source_dir}/concepts/*.md").each { |path|
file = File.basename(path)
next if file == "categories.md"
puts " -> #{file}"
process_file("#{docs_source_dir}/concepts", file, "docs/concepts", "#{$esh_repo_root}/concepts/#{file}")
}
Expand All @@ -34,12 +33,12 @@ def process_main_docs(docs_source_dir)
else
puts " Skipping non-existing section!"
end



puts ">>> Migrating the Installation section"


Dir.glob("#{docs_source_dir}/installation/*.md") { |path|
file = File.basename(path)
next if file == "designer.md"
Expand All @@ -48,12 +47,12 @@ def process_main_docs(docs_source_dir)
}
puts " -> images"
FileUtils.cp_r("#{docs_source_dir}/installation/images", "docs/installation/images")



puts ">>> Migrating the Tutorial section"


Dir.glob("#{docs_source_dir}/tutorials/beginner/*.md") { |path|
file = File.basename(path)
puts " -> #{file}"
Expand All @@ -62,12 +61,12 @@ def process_main_docs(docs_source_dir)
puts " -> images"
FileUtils.cp_r("#{docs_source_dir}/tutorials/beginner/images", "docs/tutorial/images")
# FileUtils.cp_r("#{docs_source_dir}/tutorials/images/*", "docs/tutorial/images")



puts ">>> Migrating the Configuration section"


Dir.glob("#{docs_source_dir}/configuration/*.md") { |path|
file = File.basename(path)
next if file == "transform.md" # Useless, copy the one from addons
Expand All @@ -81,12 +80,12 @@ def process_main_docs(docs_source_dir)
process_file("#{docs_source_dir}/tutorials", "migration.md", "docs/configuration/migration", "#{$docs_repo_root}/tutorials/migration.md")
FileUtils.mv("docs/configuration/migration/migration.md", "docs/configuration/migration/index.md")
FileUtils.cp_r("#{docs_source_dir}/tutorials/images", "docs/configuration/migration")



puts ">>> Migrating the UI section"


Dir.glob("#{docs_source_dir}/_addons_uis/**") { |path|
next if path =~ /habpanel/ || path =~ /paper/ # Those already have their own article, no need to include the readme...
addon = File.basename(path)
Expand All @@ -96,37 +95,37 @@ def process_main_docs(docs_source_dir)
puts " -> images (#{addon})"
FileUtils.cp_r("#{docs_source_dir}/_addons_uis/#{addon}/doc", "docs/configuration/ui/#{addon}") if Dir.exists?("#{docs_source_dir}/_addons_uis/#{addon}/doc")
}



puts ">>> Migrating the Apps section"


Dir.glob("#{docs_source_dir}/addons/uis/apps/*.md") { |path|
file = File.basename(path)
puts " -> #{file}"
process_file("#{docs_source_dir}/addons/uis/apps", file, "docs/apps", "#{$docs_repo_root}/addons/uis/apps/#{file}")
}
puts " -> images"
FileUtils.cp_r("#{docs_source_dir}/addons/uis/apps/images", "docs/apps")



puts ">>> Migrating the Administration section"


Dir.glob("#{docs_source_dir}/administration/*.md") { |path|
file = File.basename(path)
puts " -> #{file}"
process_file("#{docs_source_dir}/administration", file, "docs/administration", "#{$docs_repo_root}/administration/#{file}")
}
puts " -> images"
FileUtils.cp_r("#{docs_source_dir}/administration/images", "docs/administration/images")



puts ">>> Migrating the Developer section"


Dir.glob("#{docs_source_dir}/developers/*.md") { |path|
file = File.basename(path)
Expand All @@ -143,7 +142,6 @@ def process_main_docs(docs_source_dir)

puts " -> images"
FileUtils.cp_r("#{docs_source_dir}/developers/bindings/images", "docs/developer/bindings/images")
FileUtils.cp_r("#{docs_source_dir}/developers/legacy/images", "docs/developer/legacy/images")
FileUtils.cp_r("#{docs_source_dir}/developers/osgi/images", "docs/developer/osgi/images")
FileUtils.cp_r("#{docs_source_dir}/developers/ide/images", "docs/developer/ide/images")

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The result is available at [https://www.openhab.org/docs/](https://www.openhab.o
## How it works

In this repo you can find and improve all *general* documentation contents.
In fact that is all you can see in the `master` branch.
In fact that is all you can see in the `2.5.x` branch.
There are also other *read-only* branches, which hold external content like the *add-ons* and *concepts* documentation.
We will read about them later.

Expand Down Expand Up @@ -49,7 +49,7 @@ You can read a bit more below about our external ressources and how we get them.
### Automatically Generated Parts

Those parts include __all__ add-on documentation files, no matter if they are from the `openhab-core` repo, the
`openhab1-addons` repo, the `openhab2-addons` repo or any special binding repo like *habmin*, *zwave* or the *alexa skill*.
`openhab1-addons` repo, the `openhab-addons` repo or any special binding repo like *habmin*, *zwave* or the *alexa skill*.

We are keeping all those files at their original location, because it simply doesn't make sense to keep them here.
Imagine you want to do an improvement of the zwave binding and have to update the readme file in a completely different place.
Expand Down
44 changes: 30 additions & 14 deletions addons/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,34 @@ One can configure whether specific log entries are logged out and where they get
- `executeCommandLine(String commandLine)`: Executes a command on the command line without waiting for the command to complete
- `executeCommandLine(String commandLine, int timeout)`: Executes a command on the command and waits timeout milliseconds for the command to complete, returning the output from the command as a String

Note: The commandLine variable often has to use a special format where @@ needs to be used in place of spaces. For example the bash command touch somefile will have to be written as touch@@somefile.
::: tip Note
Simple arguments that contain no spaces can be separated with spaces, for example `executeCommandLine("touch file.txt")`.
When one or more arguments contain spaces, use `@@` instead of a space as the argument separator.
For example the bash command `touch -t 01010000 "some file with space.txt"` will have to be written as `touch@@-t@@01010000@@some file with space.txt`.
:::

### HTTP Actions

- `sendHttpGetRequest(String url)`: Sends an GET-HTTP request and returns the result as a String
- `sendHttpGetRequest(String url)`: Sends a GET-HTTP request and returns the result as a String
- `sendHttpGetRequest(String url, Map<String, String> headers, int timeout)`: Sends a GET-HTTP request with the given request headers, and timeout in ms, and returns the result as a String
- `sendHttpPutRequest(String url)`: Sends a PUT-HTTP request and returns the result as a String
- `sendHttpPutRequest(String url, String contentType, String content)`: Sends a PUT-HTTP request with the given content and returns the result as a String
- `sendHttpPutRequest(String url, String contentType, String content, Map<String, String> headers, int timeout)`: Sends a PUT-HTTP request with the given content, request headers, and timeout in ms, and returns the result as a String
- `sendHttpPostRequest(String url)`: Sends a POST-HTTP request and returns the result as a String
- `sendHttpPostRequest(String url, String contentType, String content)`: Sends a POST-HTTP request with the given content and returns the result as a String
- `sendHttpPostRequest(String url, String contentType, String content, Map<String, String> headers, int timeout)`: Sends a POST-HTTP request with the given content, request headers, and timeout in ms, and returns the result as a String
- `sendHttpDeleteRequest(String url)`: Sends a DELETE-HTTP request and returns the result as a String
- `sendHttpDeleteRequest(String url, Map<String, String> headers, int timeout)`: Sends a DELETE-HTTP request with the given request headers, and timeout in ms, and returns the result as a String

Note: All HTTP Actions can have a last `timeout` parameter added in ms. eg. `sendHttpPostRequest(String url, String contentType, String content, int timeout)`
::: tip Note
All HTTP Actions can have a last `timeout` parameter added in ms. eg. `sendHttpPostRequest(String url, String contentType, String content, int timeout)`
:::

For example:
```javascript
val headers = newHashMap("Cache-control" -> "no-cache")
val output = sendHttpGetRequest("https://example.com/?id=1", headers, 1000)
```

### Timers

Expand Down Expand Up @@ -182,31 +198,31 @@ Action | Returns
-|-
`getBankHolidayName` | name of the holiday today, or `null` if today is not a bank holiday
`getBankHolidayName(<offset>)` | name of the holiday `<offset>` days from today, `null` if that day is not a bank holiday
`getBankHolidayName(<datetime>)` | name of the holiday on the day defined by the Joda DateTime `<datetime>`, `null` if that day is not a bank holiday
`getBankHolidayName(<datetime>)` | name of the holiday on the day defined by the `ZonedDateTime` `<datetime>`, `null` if that day is not a bank holiday
`getBankHolidayName(<offset>, <file>)` | name of the day defined in `<file>` `<offest>` days from today, `null` if that day is not defined in `<file>`
`getBankHolidayName(<datetime>, <file>)` | name of the day defined in `<file>` for the day defined by the Joda DateTime `<datetime>`, `null` if that day is not defined in `<file>`
`getBankHolidayName(<datetime>, <file>)` | name of the day defined in `<file>` for the day defined by the `ZonedDateTime` `<datetime>`, `null` if that day is not defined in `<file>`
`getDaysUntil(<holiday name>)` | number of days from today to the given `<holiday name>`
`getDaysUntil(<holiday name>, <file>)` | number of days from today to the given `<holiday name>` defined in `<file>`
`getDaysUntil(<datetime>, <holiday name>)` | number of days from the day defined by the Joda DateTime `<datetime>` and `<holiday name>`
`getDaysUntil(<datetime>, <holiday name>, <file>)` | number of days from the day defined by the Joda DateTime `<datetime>` and `<holiday name>` defined in `<file>`
`getDaysUntil(<datetime>, <holiday name>)` | number of days from the day defined by the `ZonedDateTime` `<datetime>` and `<holiday name>`
`getDaysUntil(<datetime>, <holiday name>, <file>)` | number of days from the day defined by the `ZonedDateTime` `<datetime>` and `<holiday name>` defined in `<file>`
`getHolidayDescription(<holiday name>)` | Jollyday defines a mapping between the holiday name and a description. This will return the description based on the holiday name returned by `getBankHolidayName`
`getNextBankHoliday` | name of the next bank holiday
`getNextBankHoliday(<file>)` | name of the next bank holiday defined in `<file>`
`getNextBankHoliday(<offset>)` | name of the next bank holiday after `<offset>` days from today
`getNextBankHoliday(<offset>, <file>)` | name of the next bank holiday after `<offset>` days from today defined in `<file>`
`getNextBankHoliday(<datetime>)` | name of the next bank holiday after the day defined by the Joda DateTime `<datetime>`
`getNextBankHoliday(<datetime>, <file>)` | name of the next bank holiday after the day defined by the Joda DateTime `<datetime>` defined in `<file>`
`getNextBankHoliday(<datetime>)` | name of the next bank holiday after the day defined by the `ZonedDateTime` `<datetime>`
`getNextBankHoliday(<datetime>, <file>)` | name of the next bank holiday after the day defined by the `ZonedDateTime` `<datetime>` defined in `<file>`
`isBankHoliday` | `true` if today is a bank holiday (see below), `false` otherwise
`isBankHoliday(<offset>)` | `true` if the day `<offset>` days from today is a bank holiday, `false` otherwise
`isBankHoliday(<datetime>)` | `true` if the day defined by the Joda DateTime `<datetime>` is a bank holiday, `false` otherwise.
`isBankHoliday(<datetime>)` | `true` if the day defined by the `ZonedDateTime` `<datetime>` is a bank holiday, `false` otherwise.
`isBankHoliday(<offset>, <file>)` | `true` if the day `<offset>` days from today is a day defined in `<file>`, use 0 for `<offset>` for today; returns `false` otherwise
`isBankHoliday(<datetime>, <file>)` | `true` if the day defined by the Joda DateTime `<datetime>` is in `<file>`, `false` otherwise
`isBankHoliday(<datetime>, <file>)` | `true` if the day defined by the `ZonedDateTime` `<datetime>` is in `<file>`, `false` otherwise
`isInDayset("<set>")` | `true` if today is in the custom dayset `<set>` (see below), for example `isInDayset("school")`, `false` otherwise
`isInDayset("<set>", <offset>)` | `true` if the day `<offset>` days from today is in dayset `<set>`, `false` otherwise
`isInDayset("<set>", <datetime>)` | `true` if the day defined by the passed in Joda DateTime `<datetime>` os in dayset `<set>`, `false` otherwise
`isInDayset("<set>", <datetime>)` | `true` if the day defined by the passed in `ZonedDateTime` `<datetime>` os in dayset `<set>`, `false` otherwise
`isWeekend` | `true` if today is a weekend, `false` otherwise
`isWeekend(<offset>)` | `true` if the day `<offset>` days from today is a weekend
`isWeekend(<datetime>)` | `true` if the day defined by the passed in Joda DateTime is a weekend, `false` otherwise
`isWeekend(<datetime>)` | `true` if the day defined by the passed in `ZonedDateTime` `<datetime>` is a weekend, `false` otherwise

In all examples that take `<offset>`, use a negative value to check days in the past.

Expand Down Expand Up @@ -275,7 +291,7 @@ The following is an example listing a few custom days.
</tns:Holidays>
</tns:Configuration>
```
For further examples and other types of holidays that require more complicated calculations (e.g. holidays based on a lunar calendar, Easter, etc.) see the [XSD that defines the structures of the XML](https://github.com/svendiedrichsen/jollyday/blob/b78fa20e75d48bdf14e3fa8107befe44e3bacf3a/src/main/xsd/Holiday.xsd).
For further examples and to find the list of elements to reference holidays that require more complicated calculations (e.g. holidays based on a lunar calendar, Easter, etc.) see the [XSD that defines the structures of the XML](https://github.com/svendiedrichsen/jollyday/blob/b78fa20e75d48bdf14e3fa8107befe44e3bacf3a/src/main/xsd/Holiday.xsd) or the XML file for your country or others.

You can place these XML files anywhere on your file system that openHAB has permission to read.
In the calls to the Actions, use the fully qualified path.
Expand Down
10 changes: 7 additions & 3 deletions administration/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ To reach the console using SSH, use the following command to connect to the loca
ssh -p 8101 openhab@localhost
```

*Note:* By default, connection is only allowed from localhost, i.e. only from the machine running openHAB.
::: tip Note
By default, connection is only allowed from localhost, i.e. only from the machine running openHAB.
Connections are intentionally not allowed from remote hosts due to security concerns.
To change this, see [Bind Console to All Interfaces](#bind-console-to-all-interfaces).
:::

A security warning is expected upon the first connection:

Expand All @@ -57,8 +59,10 @@ The default username/password is **openhab:habopen**, so enter `habopen` at the

The first successful connection triggers generation of the Karaf remote console key and will take a few seconds longer than subsequent attempts.

*Note:* On slower systems, such as Raspberry Pi or Pine64, this first SSH connection may even time out.
::: tip Note
On slower systems, such as Raspberry Pi or Pine64, this first SSH connection may even time out.
If this happens, simply try connecting again until successful.
:::

## Using the Console

Expand Down Expand Up @@ -174,7 +178,7 @@ To enable binding to all interfaces, uncomment the line
```#org.apache.karaf.shell:sshHost = 0.0.0.0```

in `services/runtime.cfg`.


### Change the Port Number

Expand Down
Loading

0 comments on commit 7a69a0a

Please sign in to comment.