diff --git a/homeassistant/components/lutron_caseta/__init__.py b/homeassistant/components/lutron_caseta/__init__.py index f349dde8921..73eb0b83fa6 100644 --- a/homeassistant/components/lutron_caseta/__init__.py +++ b/homeassistant/components/lutron_caseta/__init__.py @@ -104,16 +104,16 @@ async def async_setup_entry(hass, config_entry): hostname=host, keyfile=keyfile, certfile=certfile, ca_certs=ca_certs ) except ssl.SSLError: - _LOGGER.error("Invalid certificate used to connect to bridge at %s.", host) + _LOGGER.error("Invalid certificate used to connect to bridge at %s", host) return False timed_out = True try: - with async_timeout.timeout(BRIDGE_TIMEOUT): + async with async_timeout.timeout(BRIDGE_TIMEOUT): await bridge.connect() timed_out = False except asyncio.TimeoutError: - _LOGGER.error("Timeout while trying to connect to bridge at %s.", host) + _LOGGER.error("Timeout while trying to connect to bridge at %s", host) if timed_out or not bridge.is_connected(): await bridge.close() diff --git a/homeassistant/components/lutron_caseta/config_flow.py b/homeassistant/components/lutron_caseta/config_flow.py index 30cbc03ac47..ab9865f999a 100644 --- a/homeassistant/components/lutron_caseta/config_flow.py +++ b/homeassistant/components/lutron_caseta/config_flow.py @@ -228,19 +228,19 @@ class LutronCasetaFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): ) except ssl.SSLError: _LOGGER.error( - "Invalid certificate used to connect to bridge at %s.", + "Invalid certificate used to connect to bridge at %s", self.data[CONF_HOST], ) return False connected_ok = False try: - with async_timeout.timeout(BRIDGE_TIMEOUT): + async with async_timeout.timeout(BRIDGE_TIMEOUT): await bridge.connect() connected_ok = bridge.is_connected() except asyncio.TimeoutError: _LOGGER.error( - "Timeout while trying to connect to bridge at %s.", + "Timeout while trying to connect to bridge at %s", self.data[CONF_HOST], )