code: def create_sensor(sensor_id, sensor, async_set_state_callback):
      
      if sensor['type'] in CONSUMPTION:
          return Consumption(sensor_id, sensor)
      if sensor['type'] in CARBONMONOXIDE:
          return CarbonMonoxide(sensor_id, sensor)
      if sensor['type'] in DAYLIGHT:
          return Daylight(sensor_id, sensor)
      if sensor['type'] in FIRE:
          return Fire(sensor_id, sensor)
      if sensor['type'] in GENERICFLAG:
          return GenericFlag(sensor_id, sensor)
      if sensor['type'] in GENERICSTATUS:
          return GenericStatus(sensor_id, sensor)
      if sensor['type'] in HUMIDITY:
          return Humidity(sensor_id, sensor)
      if sensor['type'] in LIGHTLEVEL:
          return LightLevel(sensor_id, sensor)
      if sensor['type'] in OPENCLOSE:
          return OpenClose(sensor_id, sensor)
      if sensor['type'] in POWER:
          return Power(sensor_id, sensor)
      if sensor['type'] in PRESENCE:
          return Presence(sensor_id, sensor)
      if sensor['type'] in PRESSURE:
          return Pressure(sensor_id, sensor)
      if sensor['type'] in SWITCH:
          return Switch(sensor_id, sensor)
      if sensor['type'] in TEMPERATURE:
          return Temperature(sensor_id, sensor)
      if sensor['type'] in THERMOSTAT:
          return Thermostat(sensor_id, sensor, async_set_state_callback)
      if sensor['type'] in VIBRATION:
          return Vibration(sensor_id, sensor)
      if sensor['type'] in WATER:
          return Water(sensor_id, sensor)
docs: Simplify creating sensor by not needing to know type.