Use setup_component in tests (#3414)
* Alarm Control Panel Manual - use setup_component * Update automation - zone tests * Update climate - demo tests * Update climate - generic thermostat tests * Update cover - command line tests * Update cover - demo tests * Update device tracker tests * Update device tracker - owntracks tests * Update fan - demo tests * Update garage door - demo tests * Update light tests * Update lock - demo tests * Update media player - demo tests * Update notify - command line tests * Update notify - demo tests * Update notify - file tests * Update notify - group tests * Update sensor - mfi tests * Update sensor - moldindicator tests * Update sensor - mqtt room tests * Update switch - command line * Update switch - flux * Update switch tests * Update scene tests * Fix wrong default port for mfi switch
This commit is contained in:
1 parent
d7452f9d5d
commit
4076ccf639
29 files changed
+220
-141
No files matched your search
@@ -20,7 +20,6 @@ REQUIREMENTS = ['mficlient==0.3.0']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
DEFAULT_PORT = 6443
|
||||
DEFAULT_SSL = True
|
||||
DEFAULT_VERIFY_SSL = True
|
||||
|
||||
@@ -43,7 +42,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Required(CONF_HOST): cv.string,
|
||||
vol.Required(CONF_USERNAME): cv.string,
|
||||
vol.Required(CONF_PASSWORD): cv.string,
|
||||
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
|
||||
vol.Optional(CONF_PORT): cv.port,
|
||||
vol.Optional(CONF_SSL, default=DEFAULT_SSL): cv.boolean,
|
||||
vol.Optional(CONF_VERIFY_SSL, default=DEFAULT_VERIFY_SSL): cv.boolean,
|
||||
})
|
||||
@@ -57,7 +56,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
password = config.get(CONF_PASSWORD)
|
||||
use_tls = config.get(CONF_SSL)
|
||||
verify_tls = config.get(CONF_VERIFY_SSL)
|
||||
default_port = use_tls and DEFAULT_PORT or 6080
|
||||
default_port = use_tls and 6443 or 6080
|
||||
port = int(config.get(CONF_PORT, default_port))
|
||||
|
||||
from mficlient.client import FailedToLogin, MFiClient
|
||||
|
||||
Reference in new issue
Block a user