Skip to content

Commit

Permalink
[configuration/rules-dsl.md]fixed formatting (openhab#692)
Browse files Browse the repository at this point in the history
* fixed formatting

* sentences on new lines, also escaped single units
  • Loading branch information
kaikreuzer authored and Confectrician committed Jun 3, 2018
1 parent b8cbb4b commit 76a8550
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion configuration/rules-dsl.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,9 @@ val PointType location = Device_Coordinates.state as PointType

##### Number Item

A Number Items carries either a **DecimalType** or a **QuantityType** in case the Number Item has a dimension attached (e.g. `Number:Temperature` in the items file). In rules, units are added to a number by a `|`, where the unit has to be put in quotes, if it contains non-alphabetic characters, e.g. `10|m`, but `20|"km/h"'. A couple of commonly used units do not necessarily require quotes, these are '°C', '°F', 'Ω', '°', '%', 'm²' and 'm³', so it is ok to write `20|"°C"`, but `20|°C` will also work.
A Number Items carries either a **DecimalType** or a **QuantityType** in case the Number Item has a dimension attached (e.g. `Number:Temperature` in the items file).
In rules, units are added to a number by a `|`, where the unit has to be put in quotes, if it contains non-alphabetic characters, e.g. `10|m`, but `20|"km/h"`.
A couple of commonly used units do not necessarily require quotes, these are `°C`, `°F`, `Ω`, `°`, `%`, `` and ``, so it is ok to write `20|"°C"`, but `20|°C` will also work.
DecimalType and QuantityType are also java.lang.Number so all the conversions listed above under Dimmer Item apply to Number Item as well.

Here some other commonly needed conversions:
Expand Down

0 comments on commit 76a8550

Please sign in to comment.