Modbus write_register accept single value and array (#21621)
* Update __init__.py * Update services.yaml
This commit is contained in:
parent
65ff8b727a
commit
bab53a1c94
2 changed files with 4 additions and 2 deletions
|
@ -60,7 +60,9 @@ SERVICE_WRITE_REGISTER_SCHEMA = vol.Schema({
|
|||
vol.Optional(ATTR_HUB, default=DEFAULT_HUB): cv.string,
|
||||
vol.Required(ATTR_UNIT): cv.positive_int,
|
||||
vol.Required(ATTR_ADDRESS): cv.positive_int,
|
||||
vol.Required(ATTR_VALUE): vol.All(cv.ensure_list, [cv.positive_int])
|
||||
vol.Required(ATTR_VALUE): vol.Any(
|
||||
cv.positive_int,
|
||||
vol.All(cv.ensure_list, [cv.positive_int]))
|
||||
})
|
||||
|
||||
SERVICE_WRITE_COIL_SCHEMA = vol.Schema({
|
||||
|
|
|
@ -9,4 +9,4 @@ write_register:
|
|||
fields:
|
||||
address: {description: Address of the holding register to write to., example: 0}
|
||||
unit: {description: Address of the modbus unit., example: 21}
|
||||
value: {description: Value to write., example: 0}
|
||||
value: {description: Value (single value or array) to write., example: 0 or [4,0]}
|
||||
|
|
Loading…
Add table
Reference in a new issue