Validate ports as a port (#17549)
* Validate ports as port Better than just a positive integer since it limits the range from 1 to 65535. * Validate port for Axis * Validate port for Xiaomi Home Camera * Validate port for Modbus * Validate port for Yamaha MusicCast Receivers * Update zhong_hong.py Validate port as a port, the gateway address as positive_int Also moved the default values to their variable * Validate port for the Asterisk Voicemail interface * Fix lint * Validate port for Xiaomi Cameras
This commit is contained in:
parent
50a66abd80
commit
b50c93ccb7
8 changed files with 18 additions and 15 deletions
|
@ -37,7 +37,7 @@ SERIAL_SCHEMA = {
|
|||
|
||||
ETHERNET_SCHEMA = {
|
||||
vol.Required(CONF_HOST): cv.string,
|
||||
vol.Required(CONF_PORT): cv.positive_int,
|
||||
vol.Required(CONF_PORT): cv.port,
|
||||
vol.Required(CONF_TYPE): vol.Any('tcp', 'udp', 'rtuovertcp'),
|
||||
vol.Optional(CONF_TIMEOUT, default=3): cv.socket_timeout,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue