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:
Jorim Tielemans authored and Fabian Affolter committed 2018-10-17 23:09:05 +02:00
1 parent 50a66abd80
commit b50c93ccb7
8 files changed
+18 -15

No files matched your search

+1 -1
View File
@@ -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,
}