diff --git a/homeassistant/components/smartthings/__init__.py b/homeassistant/components/smartthings/__init__.py index 555fc6ec765..93f7cbb8f32 100644 --- a/homeassistant/components/smartthings/__init__.py +++ b/homeassistant/components/smartthings/__init__.py @@ -78,8 +78,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry): """Initialize config entry which represents an installed SmartApp.""" if not validate_webhook_requirements(hass): _LOGGER.warning( - "The 'base_url' of the 'http' integration must be " - "configured and start with 'https://'" + "The 'base_url' of the 'http' integration must be configured and start with 'https://'" ) return False @@ -121,8 +120,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry): await device.status.refresh() except ClientResponseError: _LOGGER.debug( - "Unable to update status for device: %s (%s), " - "the device will be excluded", + "Unable to update status for device: %s (%s), the device will be excluded", device.label, device.device_id, exc_info=True, @@ -148,8 +146,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry): except ClientResponseError as ex: if ex.status in (401, 403): _LOGGER.exception( - "Unable to setup config entry '%s' - please " - "reconfigure the integration", + "Unable to setup config entry '%s' - please reconfigure the integration", entry.title, ) remove_entry = True @@ -186,9 +183,7 @@ async def async_get_entry_scenes(entry: ConfigEntry, api): except ClientResponseError as ex: if ex.status == 403: _LOGGER.exception( - "Unable to load scenes for config entry '%s' " - "because the access token does not have the " - "required access", + "Unable to load scenes for config entry '%s' because the access token does not have the required access", entry.title, ) else: @@ -235,7 +230,7 @@ async def async_remove_entry(hass: HomeAssistantType, entry: ConfigEntry) -> Non app_count = sum(1 for entry in all_entries if entry.data[CONF_APP_ID] == app_id) if app_count > 1: _LOGGER.debug( - "App %s was not removed because it is in use by other" "config entries", + "App %s was not removed because it is in use by other config entries", app_id, ) return diff --git a/homeassistant/components/smartthings/climate.py b/homeassistant/components/smartthings/climate.py index bb307523e97..4f005a326cd 100644 --- a/homeassistant/components/smartthings/climate.py +++ b/homeassistant/components/smartthings/climate.py @@ -406,7 +406,7 @@ class SmartThingsAirConditioner(SmartThingsEntity, ClimateDevice): modes.add(state) else: _LOGGER.debug( - "Device %s (%s) returned an invalid supported " "AC mode: %s", + "Device %s (%s) returned an invalid supported AC mode: %s", self._device.label, self._device.device_id, mode, diff --git a/homeassistant/components/smartthings/const.py b/homeassistant/components/smartthings/const.py index cd9fc1ccdf8..c258101da70 100644 --- a/homeassistant/components/smartthings/const.py +++ b/homeassistant/components/smartthings/const.py @@ -37,8 +37,5 @@ SUPPORTED_PLATFORMS = [ "scene", ] TOKEN_REFRESH_INTERVAL = timedelta(days=14) -VAL_UID = ( - "^(?:([0-9a-fA-F]{32})|([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]" - "{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}))$" -) +VAL_UID = "^(?:([0-9a-fA-F]{32})|([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}))$" VAL_UID_MATCHER = re.compile(VAL_UID) diff --git a/homeassistant/components/smartthings/smartapp.py b/homeassistant/components/smartthings/smartapp.py index b152ba3328f..b64ba690d41 100644 --- a/homeassistant/components/smartthings/smartapp.py +++ b/homeassistant/components/smartthings/smartapp.py @@ -77,8 +77,7 @@ async def validate_installed_app(api, installed_app_id: str): installed_app = await api.installed_app(installed_app_id) if installed_app.installed_app_status != InstalledAppStatus.AUTHORIZED: raise RuntimeWarning( - "Installed SmartApp instance '{}' ({}) is not " - "AUTHORIZED but instead {}".format( + "Installed SmartApp instance '{}' ({}) is not AUTHORIZED but instead {}".format( installed_app.display_name, installed_app.installed_app_id, installed_app.installed_app_status, @@ -321,7 +320,7 @@ async def smartapp_sync_subscriptions( ) except Exception as error: # pylint:disable=broad-except _LOGGER.error( - "Failed to create subscription for '%s' under app " "'%s': %s", + "Failed to create subscription for '%s' under app '%s': %s", target, installed_app_id, error, @@ -331,8 +330,7 @@ async def smartapp_sync_subscriptions( try: await api.delete_subscription(installed_app_id, sub.subscription_id) _LOGGER.debug( - "Removed subscription for '%s' under app '%s' " - "because it was no longer needed", + "Removed subscription for '%s' under app '%s' because it was no longer needed", sub.capability, installed_app_id, ) diff --git a/tests/components/smartthings/test_init.py b/tests/components/smartthings/test_init.py index 15b556f1d83..4e1ffce7e22 100644 --- a/tests/components/smartthings/test_init.py +++ b/tests/components/smartthings/test_init.py @@ -371,7 +371,7 @@ async def test_broker_regenerates_token(hass, config_entry): stored_action = action with patch( - "homeassistant.components.smartthings" ".async_track_time_interval", + "homeassistant.components.smartthings.async_track_time_interval", new=async_track_time_interval, ): broker = smartthings.DeviceBroker(hass, config_entry, token, Mock(), [], [])