diff --git a/homeassistant/components/anel_pwrctrl/switch.py b/homeassistant/components/anel_pwrctrl/switch.py index 36306f18114..cc6011d9b65 100644 --- a/homeassistant/components/anel_pwrctrl/switch.py +++ b/homeassistant/components/anel_pwrctrl/switch.py @@ -31,10 +31,10 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( def setup_platform(hass, config, add_entities, discovery_info=None): """Set up PwrCtrl devices/switches.""" host = config.get(CONF_HOST) - username = config.get(CONF_USERNAME) - password = config.get(CONF_PASSWORD) - port_recv = config.get(CONF_PORT_RECV) - port_send = config.get(CONF_PORT_SEND) + username = config[CONF_USERNAME] + password = config[CONF_PASSWORD] + port_recv = config[CONF_PORT_RECV] + port_send = config[CONF_PORT_SEND] try: master = DeviceMaster( diff --git a/homeassistant/components/anthemav/media_player.py b/homeassistant/components/anthemav/media_player.py index 40317ef1728..434692ce6f5 100644 --- a/homeassistant/components/anthemav/media_player.py +++ b/homeassistant/components/anthemav/media_player.py @@ -53,8 +53,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up our socket to the AVR.""" - host = config.get(CONF_HOST) - port = config.get(CONF_PORT) + host = config[CONF_HOST] + port = config[CONF_PORT] name = config.get(CONF_NAME) device = None diff --git a/homeassistant/components/apcupsd/__init__.py b/homeassistant/components/apcupsd/__init__.py index 967b5855a51..1f024bf5882 100644 --- a/homeassistant/components/apcupsd/__init__.py +++ b/homeassistant/components/apcupsd/__init__.py @@ -37,8 +37,8 @@ CONFIG_SCHEMA = vol.Schema( def setup(hass, config): """Use config values to set up a function enabling status retrieval.""" conf = config[DOMAIN] - host = conf.get(CONF_HOST) - port = conf.get(CONF_PORT) + host = conf[CONF_HOST] + port = conf[CONF_PORT] apcups_data = APCUPSdData(host, port) hass.data[DOMAIN] = apcups_data diff --git a/homeassistant/components/apcupsd/binary_sensor.py b/homeassistant/components/apcupsd/binary_sensor.py index e07f97c928c..000e738052d 100644 --- a/homeassistant/components/apcupsd/binary_sensor.py +++ b/homeassistant/components/apcupsd/binary_sensor.py @@ -32,7 +32,7 @@ class OnlineStatus(BinarySensorDevice): @property def name(self): """Return the name of the UPS online status sensor.""" - return self._config.get(CONF_NAME) + return self._config[CONF_NAME] @property def is_on(self): diff --git a/homeassistant/components/apns/notify.py b/homeassistant/components/apns/notify.py index 3cd43ee36ae..59b2a7aa9fa 100644 --- a/homeassistant/components/apns/notify.py +++ b/homeassistant/components/apns/notify.py @@ -45,10 +45,10 @@ REGISTER_SERVICE_SCHEMA = vol.Schema( def get_service(hass, config, discovery_info=None): """Return push service.""" - name = config.get(CONF_NAME) - cert_file = config.get(CONF_CERTFILE) - topic = config.get(CONF_TOPIC) - sandbox = config.get(CONF_SANDBOX) + name = config[CONF_NAME] + cert_file = config[CONF_CERTFILE] + topic = config[CONF_TOPIC] + sandbox = config[CONF_SANDBOX] service = ApnsNotificationService(hass, name, topic, sandbox, cert_file) hass.services.register( diff --git a/homeassistant/components/aqualogic/sensor.py b/homeassistant/components/aqualogic/sensor.py index ce2ecb89d8f..74a70f0b11c 100644 --- a/homeassistant/components/aqualogic/sensor.py +++ b/homeassistant/components/aqualogic/sensor.py @@ -52,7 +52,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= sensors = [] processor = hass.data[DOMAIN] - for sensor_type in config.get(CONF_MONITORED_CONDITIONS): + for sensor_type in config[CONF_MONITORED_CONDITIONS]: sensors.append(AquaLogicSensor(processor, sensor_type)) async_add_entities(sensors) diff --git a/homeassistant/components/aqualogic/switch.py b/homeassistant/components/aqualogic/switch.py index c00510b563a..d949175bc6e 100644 --- a/homeassistant/components/aqualogic/switch.py +++ b/homeassistant/components/aqualogic/switch.py @@ -39,7 +39,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= switches = [] processor = hass.data[DOMAIN] - for switch_type in config.get(CONF_MONITORED_CONDITIONS): + for switch_type in config[CONF_MONITORED_CONDITIONS]: switches.append(AquaLogicSwitch(processor, switch_type)) async_add_entities(switches) diff --git a/homeassistant/components/aquostv/media_player.py b/homeassistant/components/aquostv/media_player.py index 3895dafe1fa..d5383590868 100644 --- a/homeassistant/components/aquostv/media_player.py +++ b/homeassistant/components/aquostv/media_player.py @@ -79,11 +79,11 @@ SOURCES = { def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Sharp Aquos TV platform.""" - name = config.get(CONF_NAME) - port = config.get(CONF_PORT) - username = config.get(CONF_USERNAME) - password = config.get(CONF_PASSWORD) - power_on_enabled = config.get("power_on_enabled") + name = config[CONF_NAME] + port = config[CONF_PORT] + username = config[CONF_USERNAME] + password = config[CONF_PASSWORD] + power_on_enabled = config["power_on_enabled"] if discovery_info: _LOGGER.debug("%s", discovery_info) @@ -96,7 +96,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): add_entities([SharpAquosTVDevice(name, remote, power_on_enabled)]) return True - host = config.get(CONF_HOST) + host = config[CONF_HOST] remote = sharp_aquos_rc.TV(host, port, username, password, 15, 1) add_entities([SharpAquosTVDevice(name, remote, power_on_enabled)]) diff --git a/homeassistant/components/arduino/sensor.py b/homeassistant/components/arduino/sensor.py index 9178e99e0f9..8da656d217a 100644 --- a/homeassistant/components/arduino/sensor.py +++ b/homeassistant/components/arduino/sensor.py @@ -26,7 +26,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Arduino platform.""" board = hass.data[DOMAIN] - pins = config.get(CONF_PINS) + pins = config[CONF_PINS] sensors = [] for pinnum, pin in pins.items(): diff --git a/homeassistant/components/arduino/switch.py b/homeassistant/components/arduino/switch.py index 7ce4de69f4f..ea6f36ac7f5 100644 --- a/homeassistant/components/arduino/switch.py +++ b/homeassistant/components/arduino/switch.py @@ -33,7 +33,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Arduino platform.""" board = hass.data[DOMAIN] - pins = config.get(CONF_PINS) + pins = config[CONF_PINS] switches = [] for pinnum, pin in pins.items(): @@ -47,13 +47,13 @@ class ArduinoSwitch(SwitchDevice): def __init__(self, pin, options, board): """Initialize the Pin.""" self._pin = pin - self._name = options.get(CONF_NAME) + self._name = options[CONF_NAME] self.pin_type = CONF_TYPE self.direction = "out" - self._state = options.get(CONF_INITIAL) + self._state = options[CONF_INITIAL] - if options.get(CONF_NEGATE): + if options[CONF_NEGATE]: self.turn_on_handler = board.set_digital_out_low self.turn_off_handler = board.set_digital_out_high else: diff --git a/homeassistant/components/arest/binary_sensor.py b/homeassistant/components/arest/binary_sensor.py index 3bd0a85c6f0..d84b79f1d4c 100644 --- a/homeassistant/components/arest/binary_sensor.py +++ b/homeassistant/components/arest/binary_sensor.py @@ -30,8 +30,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the aREST binary sensor.""" - resource = config.get(CONF_RESOURCE) - pin = config.get(CONF_PIN) + resource = config[CONF_RESOURCE] + pin = config[CONF_PIN] device_class = config.get(CONF_DEVICE_CLASS) try: diff --git a/homeassistant/components/arest/sensor.py b/homeassistant/components/arest/sensor.py index 1bb34a11693..b118422ef8c 100644 --- a/homeassistant/components/arest/sensor.py +++ b/homeassistant/components/arest/sensor.py @@ -51,9 +51,9 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the aREST sensor.""" - resource = config.get(CONF_RESOURCE) - var_conf = config.get(CONF_MONITORED_VARIABLES) - pins = config.get(CONF_PINS) + resource = config[CONF_RESOURCE] + var_conf = config[CONF_MONITORED_VARIABLES] + pins = config[CONF_PINS] try: response = requests.get(resource, timeout=10).json() diff --git a/homeassistant/components/arest/switch.py b/homeassistant/components/arest/switch.py index d3a51391627..298ac106dec 100644 --- a/homeassistant/components/arest/switch.py +++ b/homeassistant/components/arest/switch.py @@ -40,7 +40,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the aREST switches.""" - resource = config.get(CONF_RESOURCE) + resource = config[CONF_RESOURCE] try: response = requests.get(resource, timeout=10) @@ -54,7 +54,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): return False dev = [] - pins = config.get(CONF_PINS) + pins = config[CONF_PINS] for pinnum, pin in pins.items(): dev.append( ArestSwitchPin( @@ -62,11 +62,11 @@ def setup_platform(hass, config, add_entities, discovery_info=None): config.get(CONF_NAME, response.json()[CONF_NAME]), pin.get(CONF_NAME), pinnum, - pin.get(CONF_INVERT), + pin[CONF_INVERT], ) ) - functions = config.get(CONF_FUNCTIONS) + functions = config[CONF_FUNCTIONS] for funcname, func in functions.items(): dev.append( ArestSwitchFunction( diff --git a/homeassistant/components/arlo/__init__.py b/homeassistant/components/arlo/__init__.py index 40d75d557bb..3cc0ec607a5 100644 --- a/homeassistant/components/arlo/__init__.py +++ b/homeassistant/components/arlo/__init__.py @@ -43,9 +43,9 @@ CONFIG_SCHEMA = vol.Schema( def setup(hass, config): """Set up an Arlo component.""" conf = config[DOMAIN] - username = conf.get(CONF_USERNAME) - password = conf.get(CONF_PASSWORD) - scan_interval = conf.get(CONF_SCAN_INTERVAL) + username = conf[CONF_USERNAME] + password = conf[CONF_PASSWORD] + scan_interval = conf[CONF_SCAN_INTERVAL] try: diff --git a/homeassistant/components/arlo/alarm_control_panel.py b/homeassistant/components/arlo/alarm_control_panel.py index 5e5597f50da..7440db0495e 100644 --- a/homeassistant/components/arlo/alarm_control_panel.py +++ b/homeassistant/components/arlo/alarm_control_panel.py @@ -53,9 +53,9 @@ def setup_platform(hass, config, add_entities, discovery_info=None): if not arlo.base_stations: return - home_mode_name = config.get(CONF_HOME_MODE_NAME) - away_mode_name = config.get(CONF_AWAY_MODE_NAME) - night_mode_name = config.get(CONF_NIGHT_MODE_NAME) + home_mode_name = config[CONF_HOME_MODE_NAME] + away_mode_name = config[CONF_AWAY_MODE_NAME] + night_mode_name = config[CONF_NIGHT_MODE_NAME] base_stations = [] for base_station in arlo.base_stations: base_stations.append( diff --git a/homeassistant/components/arlo/sensor.py b/homeassistant/components/arlo/sensor.py index 10f8d670108..9942ce687f4 100644 --- a/homeassistant/components/arlo/sensor.py +++ b/homeassistant/components/arlo/sensor.py @@ -51,7 +51,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): return sensors = [] - for sensor_type in config.get(CONF_MONITORED_CONDITIONS): + for sensor_type in config[CONF_MONITORED_CONDITIONS]: if sensor_type == "total_cameras": sensors.append(ArloSensor(SENSOR_TYPES[sensor_type][0], arlo, sensor_type)) else: diff --git a/homeassistant/components/asterisk_mbox/__init__.py b/homeassistant/components/asterisk_mbox/__init__.py index 1ecba9f4c8f..ca511267302 100644 --- a/homeassistant/components/asterisk_mbox/__init__.py +++ b/homeassistant/components/asterisk_mbox/__init__.py @@ -43,9 +43,9 @@ def setup(hass, config): """Set up for the Asterisk Voicemail box.""" conf = config.get(DOMAIN) - host = conf.get(CONF_HOST) - port = conf.get(CONF_PORT) - password = conf.get(CONF_PASSWORD) + host = conf[CONF_HOST] + port = conf[CONF_PORT] + password = conf[CONF_PASSWORD] hass.data[DOMAIN] = AsteriskData(hass, host, port, password, config) diff --git a/homeassistant/components/aurora/binary_sensor.py b/homeassistant/components/aurora/binary_sensor.py index 6963d836685..e2f07276c6c 100644 --- a/homeassistant/components/aurora/binary_sensor.py +++ b/homeassistant/components/aurora/binary_sensor.py @@ -41,8 +41,8 @@ def setup_platform(hass, config, add_entities, discovery_info=None): _LOGGER.error("Lat. or long. not set in Home Assistant config") return False - name = config.get(CONF_NAME) - threshold = config.get(CONF_THRESHOLD) + name = config[CONF_NAME] + threshold = config[CONF_THRESHOLD] try: aurora_data = AuroraData(hass.config.latitude, hass.config.longitude, threshold) diff --git a/homeassistant/components/baidu/tts.py b/homeassistant/components/baidu/tts.py index 4208750b7fc..2d0857de135 100644 --- a/homeassistant/components/baidu/tts.py +++ b/homeassistant/components/baidu/tts.py @@ -63,21 +63,21 @@ class BaiduTTSProvider(Provider): def __init__(self, hass, conf): """Init Baidu TTS service.""" self.hass = hass - self._lang = conf.get(CONF_LANG) + self._lang = conf[CONF_LANG] self._codec = "mp3" self.name = "BaiduTTS" self._app_data = { - "appid": conf.get(CONF_APP_ID), - "apikey": conf.get(CONF_API_KEY), - "secretkey": conf.get(CONF_SECRET_KEY), + "appid": conf[CONF_APP_ID], + "apikey": conf[CONF_API_KEY], + "secretkey": conf[CONF_SECRET_KEY], } self._speech_conf_data = { - _OPTIONS[CONF_PERSON]: conf.get(CONF_PERSON), - _OPTIONS[CONF_PITCH]: conf.get(CONF_PITCH), - _OPTIONS[CONF_SPEED]: conf.get(CONF_SPEED), - _OPTIONS[CONF_VOLUME]: conf.get(CONF_VOLUME), + _OPTIONS[CONF_PERSON]: conf[CONF_PERSON], + _OPTIONS[CONF_PITCH]: conf[CONF_PITCH], + _OPTIONS[CONF_SPEED]: conf[CONF_SPEED], + _OPTIONS[CONF_VOLUME]: conf[CONF_VOLUME], } @property diff --git a/homeassistant/components/bayesian/binary_sensor.py b/homeassistant/components/bayesian/binary_sensor.py index 78b30557fce..724cb756f65 100644 --- a/homeassistant/components/bayesian/binary_sensor.py +++ b/homeassistant/components/bayesian/binary_sensor.py @@ -97,10 +97,10 @@ def update_probability(prior, prob_given_true, prob_given_false): async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the Bayesian Binary sensor.""" - name = config.get(CONF_NAME) - observations = config.get(CONF_OBSERVATIONS) - prior = config.get(CONF_PRIOR) - probability_threshold = config.get(CONF_PROBABILITY_THRESHOLD) + name = config[CONF_NAME] + observations = config[CONF_OBSERVATIONS] + prior = config[CONF_PRIOR] + probability_threshold = config[CONF_PROBABILITY_THRESHOLD] device_class = config.get(CONF_DEVICE_CLASS) async_add_entities(