From 03cae17992b891901adcc3d6951ec6d331c1fbaa Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 4 Apr 2020 22:08:49 +0200 Subject: [PATCH] Use str literals (#33654) --- homeassistant/components/rachio/switch.py | 4 ++-- homeassistant/components/rachio/webhooks.py | 2 +- homeassistant/components/zwave/config_flow.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/rachio/switch.py b/homeassistant/components/rachio/switch.py index 2b9a959deb2..764f87e924c 100644 --- a/homeassistant/components/rachio/switch.py +++ b/homeassistant/components/rachio/switch.py @@ -192,7 +192,7 @@ class RachioZone(RachioSwitch): self._person = person self._shade_type = data.get(KEY_CUSTOM_SHADE, {}).get(KEY_NAME) self._zone_type = data.get(KEY_CUSTOM_CROP, {}).get(KEY_NAME) - self._summary = str() + self._summary = "" self._current_schedule = current_schedule super().__init__(controller, poll=False) self._state = self.zone_id == self._current_schedule.get(KEY_ZONE_ID) @@ -275,7 +275,7 @@ class RachioZone(RachioSwitch): if args[0][KEY_ZONE_ID] != self.zone_id: return - self._summary = kwargs.get(KEY_SUMMARY, str()) + self._summary = kwargs.get(KEY_SUMMARY, "") if args[0][KEY_SUBTYPE] == SUBTYPE_ZONE_STARTED: self._state = True diff --git a/homeassistant/components/rachio/webhooks.py b/homeassistant/components/rachio/webhooks.py index 7051ec046d8..e31b32e9410 100644 --- a/homeassistant/components/rachio/webhooks.py +++ b/homeassistant/components/rachio/webhooks.py @@ -88,7 +88,7 @@ class RachioWebhookView(HomeAssistantView): data = await request.json() try: - auth = data.get(KEY_EXTERNAL_ID, str()).split(":")[1] + auth = data.get(KEY_EXTERNAL_ID, "").split(":")[1] assert auth == hass.data[DOMAIN][self._entry_id].rachio.webhook_auth except (AssertionError, IndexError): return web.Response(status=web.HTTPForbidden.status_code) diff --git a/homeassistant/components/zwave/config_flow.py b/homeassistant/components/zwave/config_flow.py index 6d7dc012e85..cff197b7e97 100644 --- a/homeassistant/components/zwave/config_flow.py +++ b/homeassistant/components/zwave/config_flow.py @@ -66,7 +66,7 @@ class ZwaveFlowHandler(config_entries.ConfigFlow): # Generate a random key from random import choice - key = str() + key = "" for i in range(16): key += "0x" key += choice("1234567890ABCDEF")