
from homeassistant.components.insteon import (INSTEON, InsteonToggleDevice)


def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up the Insteon Hub light platform. """
    devs = []
    for device in INSTEON.devices:
        if device.DeviceCategory == "Switched Lighting Control":
            devs.append(InsteonToggleDevice(device))
    add_devices(devs)


from homeassistant.components.insteon import (INSTEON, InsteonToggleDevice)


def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up the Insteon Hub light platform. """
    devs = []
    for device in INSTEON.devices:
        if device.DeviceCategory == "Switched Lighting Control":
            devs.append(InsteonToggleDevice(device))
        if device.DeviceCategory == "Dimmable Lighting Control":
            devs.append(InsteonToggleDevice(device))
    add_devices(devs)

Add ability to control dimmable sources
Add ability to control dimmable sources

  
  from homeassistant.components.insteon import (INSTEON, InsteonToggleDevice)
  
  
  def setup_platform(hass, config, add_devices, discovery_info=None):
      """ Sets up the Insteon Hub light platform. """
      devs = []
      for device in INSTEON.devices:
          if device.DeviceCategory == "Switched Lighting Control":
              devs.append(InsteonToggleDevice(device))
+         if device.DeviceCategory == "Dimmable Lighting Control":
+             devs.append(InsteonToggleDevice(device))
      add_devices(devs)
  
Add ability to control dimmable sources
## Code Before:

from homeassistant.components.insteon import (INSTEON, InsteonToggleDevice)


def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up the Insteon Hub light platform. """
    devs = []
    for device in INSTEON.devices:
        if device.DeviceCategory == "Switched Lighting Control":
            devs.append(InsteonToggleDevice(device))
    add_devices(devs)

## Instruction:
Add ability to control dimmable sources
## Code After:

from homeassistant.components.insteon import (INSTEON, InsteonToggleDevice)


def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up the Insteon Hub light platform. """
    devs = []
    for device in INSTEON.devices:
        if device.DeviceCategory == "Switched Lighting Control":
            devs.append(InsteonToggleDevice(device))
        if device.DeviceCategory == "Dimmable Lighting Control":
            devs.append(InsteonToggleDevice(device))
    add_devices(devs)
