[http] enable UoM for number channels (#9601)

* add unit

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>

* documentation an XML

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>

* address review comments

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>

* improvements

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>

* improvements

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
J-N-K
2021-01-06 22:12:31 +01:00
committed by GitHub
parent cb5d659c9e
commit 1480c41606
7 changed files with 166 additions and 13 deletions

View File

@@ -101,6 +101,16 @@ All values that are not `onValue`, `offValue`, `increaseValue`, `decreaseValue`
All values that are not `onValue`, `offValue`, `increaseValue`, `decreaseValue` are interpreted as brightness 0-100% and need to be numeric only.
### `number`
| parameter | optional | default | description |
|-------------------------|----------|-------------|-------------|
| `unit` | yes | - | The unit label for this channel |
`number` channels can be used for `DecimalType` or `QuantityType` values.
If a unit is given in the `unit` parameter, the binding tries to create a `QuantityType` state before updating the channel, if no unit is present, it creates a `DecimalType`.
Please note that incompatible units (e.g. `°C` for a `Number:Density` item) will fail silently, i.e. no error message is logged even if the state update fails.
### `player`
| parameter | optional | default | description |