mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Modbus write_register accept single value and array (#21621)
* Update __init__.py * Update services.yaml
This commit is contained in:
parent
65ff8b727a
commit
bab53a1c94
@ -60,7 +60,9 @@ SERVICE_WRITE_REGISTER_SCHEMA = vol.Schema({
|
|||||||
vol.Optional(ATTR_HUB, default=DEFAULT_HUB): cv.string,
|
vol.Optional(ATTR_HUB, default=DEFAULT_HUB): cv.string,
|
||||||
vol.Required(ATTR_UNIT): cv.positive_int,
|
vol.Required(ATTR_UNIT): cv.positive_int,
|
||||||
vol.Required(ATTR_ADDRESS): 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({
|
SERVICE_WRITE_COIL_SCHEMA = vol.Schema({
|
||||||
|
@ -9,4 +9,4 @@ write_register:
|
|||||||
fields:
|
fields:
|
||||||
address: {description: Address of the holding register to write to., example: 0}
|
address: {description: Address of the holding register to write to., example: 0}
|
||||||
unit: {description: Address of the modbus unit., example: 21}
|
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…
x
Reference in New Issue
Block a user