Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions homeassistant/components/smartthings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -121,8 +120,7 @@ async def retrieve_device_status(device):
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,
Expand All @@ -148,8 +146,7 @@ async def retrieve_device_status(device):
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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/smartthings/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ async def async_update(self):
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,
Expand Down
5 changes: 1 addition & 4 deletions homeassistant/components/smartthings/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,5 @@
"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)
8 changes: 3 additions & 5 deletions homeassistant/components/smartthings/smartapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -321,7 +320,7 @@ async def create_subscription(target: str):
)
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,
Expand All @@ -331,8 +330,7 @@ async def delete_subscription(sub: SubscriptionEntity):
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,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/components/smartthings/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def async_track_time_interval(hass, action, interval):
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(), [], [])
Expand Down