Procházet zdrojové kódy

Fix syntax checking for None and if block.

Jason Rumney před 4 roky
rodič
revize
bb771ef3c4
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. 3 2
      custom_components/tuya_local/__init__.py

+ 3 - 2
custom_components/tuya_local/__init__.py

@@ -43,8 +43,8 @@ async def async_migrate_entry(hass, entry: ConfigEntry):
         if config[CONF_TYPE] == CONF_TYPE_AUTO:
             device = setup_device(hass, config)
             config[CONF_TYPE] = await device.async_inferred_type()
-            if config[CONF_TYPE] == None
-            return False
+            if config[CONF_TYPE] is None:
+                return False
 
         entry.data = {
             CONF_DEVICE_ID: config[CONF_DEVICE_ID],
@@ -63,6 +63,7 @@ async def async_migrate_entry(hass, entry: ConfigEntry):
         entry.version = 2
         return True
 
+
 async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
     _LOGGER.debug(f"Setting up entry for device: {entry.data[CONF_DEVICE_ID]}")
     config = {**entry.data, **entry.options, "name": entry.title}